Skip to main content

Hierarchy

  • ISwitchboardOracle
    • DockerOracle

Index

Constructors

constructor

Properties

readonlyarch

arch: linux/arm64 | linux/amd64

readonlychain

chain: Chain

readonlyconfig

optionaldockerOracleProcess

dockerOracleProcess?: ChildProcess

readonlydockerRunFlags

dockerRunFlags: string[]

readonlyenvVariables

envVariables: Record<string, string>

readonlyimage

image: string

readonlyimageTag

imageTag: string

isActive

isActive: boolean = true

logFile

logFile: string

publiclogs

logs: string[] = []

readonlynetwork

network: Network

onCloseCallback

onCloseCallback: (code: number, signal: Signals) => void

Type declaration

    • (code: number, signal: Signals): void
    • Parameters

      • code: number
      • signal: Signals

      Returns void

onDataCallback

onDataCallback: (data: any) => void

Type declaration

    • (data: any): void
    • Parameters

      • data: any

      Returns void

onErrorCallback

onErrorCallback: (error: Error) => void

Type declaration

    • (error: Error): void
    • Parameters

      • error: Error

      Returns void

readonlysecretPath

secretPath: string

readonlysilent

silent: boolean

readonlyswitchboardDirectory

switchboardDirectory: string

readonlytimestamp

timestamp: number = ...

Methods

publicaddLog

  • addLog(log: string): void
  • Parameters

    • log: string

    Returns void

amIAContainer

  • amIAContainer(): boolean
  • Returns boolean

awaitReady

  • awaitReady(timeout?: number): Promise<void>
  • @throws

    if timeout is exceeded and oracle heartbeat was never detected


    Parameters

    • timeout: number = 60

      the number of seconds to await for the oracle to start successfully heartbeating

    Returns Promise<void>

checkDockerHealthStatus

  • checkDockerHealthStatus(): boolean
  • Returns boolean

createOracle

  • createOracle(): void
  • Returns void

kill

  • kill(exitCode?: number): void
  • Force kill the child_process


    Parameters

    • exitCode: number = 1

    Returns void

publicsaveLogs

  • saveLogs(): void
  • Save an array of oracle logs


    Returns void

start

  • start(): void
  • Start a Docker process with the oracle running. If an existing oracle is detected, it will re-attach to the container.


    Returns void

publicstartAndAwait

  • startAndAwait(timeout?: number): Promise<void>
  • Start a Docker process with the oracle running and await for the oracle to signal readiness. If an existing oracle is detected, it will re-attach to the container.

    @throws

    if timeout is exceeded and oracle heartbeat was never detected


    Parameters

    • timeout: number = 60

      the number of seconds to await for the oracle to start successfully heartbeating

    Returns Promise<void>

stop

  • stop(): boolean
  • Stop the docker oracle process


    Returns boolean

publicstaticcheckDockerHealthStatus

  • checkDockerHealthStatus(containerName: string): boolean
  • Parameters

    • containerName: string

    Returns boolean

publicstaticfromReleaseChannel

publicstaticisDockerRunning

  • isDockerRunning(): void
  • Returns void

publicstaticparseEnvVariables

  • Parameters

    Returns Record<string, string>