Class DevnetContainerAbstract

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

Hierarchy (view full)

Implements

Constructors

Properties

chainId?: string

Chain ID of chain node running inside devnet container.

container: Container = ...

Container instance of devnet.

created: Promise<DevnetContainer>

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"

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<DevnetContainer>

Wait for the devnet to be stopped.

platformName: Platform

Name of devnet platform.

platformVersion: string

Version of devnet platform.

removed: Promise<DevnetContainer>

Wait for the devnet to be removed.

running: boolean = false

Whether the devnet container is started.

started: Promise<DevnetContainer>

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

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

    Parameters

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

    Returns Promise<any>

  • Get info for named genesis account, including the mnemonic

    Parameters

    • name: string | {
          name?: string;
      }

    Returns Promise<Partial<Identity> & {
        mnemonic: string;
    }>

Generated using TypeDoc