A private local instance of a network, running in a container managed by @fadroma/oci.

Type Parameters

Hierarchy

  • DevnetContainerConfig
    • Container

Implements

Constructors

Properties

Connection: (new (...args) => C)

Connection class for this devnet.

Type declaration

    • new (...args): C
    • Connection class for this devnet.

      Parameters

      • Rest ...args: unknown[]

      Returns C

Identity: (new (...args) => I)

Identity class for this devnet.

Type declaration

    • new (...args): I
    • Identity class for this devnet.

      Parameters

      • Rest ...args: unknown[]

      Returns I

chainId?: string

Chain ID of chain node running inside devnet container.

container: Container
created: Promise<Container<C, I>>

Wait for the devnet to be created.

exitHandler?: ((...args) => void)

The exit handler that cleans up external resources.

Type declaration

    • (...args): void
    • The exit handler that cleans up external resources.

      Parameters

      • Rest ...args: any

      Returns void

gasToken?: Native

Denomination of base gas token for this chain.

genesisAccounts: Record<string, string | number | bigint> = {}

Initial accounts.

genesisUploads: Record<string, Partial<CompiledCode>> = {}

Initial uploads.

initScript: Path = ...

If set, overrides the script that launches the devnet in the container.

log: Core.Console = ...

Logger.

nodeBinary?: string

Name of binary in container to start.

nodeHost: string = 'localhost'

The hostname of the API URL.

nodePort?: string | number

The port of the API URL.

nodePortMode?: APIMode

Which service does the API URL port correspond to.

nodeProtocol: string = 'http'

The protocol of the API URL without the trailing colon.

onScriptExit: "remove" | "pause" | "remain" = 'remove'

What to do with the devnet once the process that has spawned it exits.

  • "remain": the devnet container keeps running
  • "pause": the devnet container is stopped
  • "remove": the devnet container is stopped and removed, along with the state directory
paused: Promise<Container<C, I>>

Wait for the devnet to be stopped.

platformName: "default" | "scrt" | "okp4" | "archway" | "osmosis" | "injective" | "axelar"

Name of devnet platform.

platformVersion: string

Version of devnet platform.

removed: Promise<Container<C, I>>

Wait for the devnet to be removed.

running: boolean = false

Whether the devnet container is started.

started: Promise<Container<C, I>>

Wait for the devnet to be started.

stateRoot: Directory

This directory contains the state of all devnets, e.g. ~/.local/share/fadroma/devnets. The devnet container will create a subdirectory named after the chain ID.

url?: string | URL

URL for connecting to a remote devnet.

verbose: boolean = false

Whether more detailed output is preferred.

waitMore: number = 7

Seconds to wait after first block. Tests override this to save time.

waitPort: ((__namedParameters) => Promise<void>) = waitPort

Function that waits for port to open after launching container. Tests override this to save time.

Type declaration

    • (__namedParameters): Promise<void>
    • Function that waits for port to open after launching container. Tests override this to save time.

      Parameters

      • __namedParameters: {
            host: string;
            interval?: number;
            port: number;
            retries?: number;
        }
        • host: string
        • Optional interval?: number
        • port: number
        • Optional retries?: number

      Returns Promise<void>

waitString: string = ''

Once this phrase is encountered in the log output from the container, the devnet is ready to accept requests.

Accessors

  • get runFile(): File
  • This file is created when the container is started. Deleting it tells the script running inside the container to kill the devnet.

    Returns File

  • get stateDir(): Directory
  • This directory contains the state of the devnet, such as statefile, runfile, genesis accounts.

    Returns Directory

  • get stateFile(): File
  • This file contains the state of the devnet, such as container ID.

    Returns File

Methods

  • Obtain a Connection object to this devnet, optionally with a specific Identity.

    Parameters

    • Optional parameter: string | Partial<I>

    Returns Promise<C>

  • Export the contents of the devnet as a container image.

    Parameters

    • repository: string = ...
    • tag: string = ...

    Returns Promise<any>

Generated using TypeDoc