Skip to content

nooschain v0.1.0


nooschain / chain/state-root-sidecar-supervisor / StateRootSidecarSupervisor

Class: StateRootSidecarSupervisor

Defined in: chain/state-root-sidecar-supervisor.ts:80

Supervises the external Nervos state-root process independently from block execution. It starts only when explicitly enabled, prewarmed, or when a scheduled/active Nervos activation makes the sidecar operationally relevant.

Constructors

Constructor

new StateRootSidecarSupervisor(database, logger?, sidecarConfigOverride?): StateRootSidecarSupervisor

Defined in: chain/state-root-sidecar-supervisor.ts:99

Parameters

database

StateRootEngineScheduleDatabase

logger?

Pick<Logger, "error" | "warn" | "info">

sidecarConfigOverride?

PersistentStateRootSidecarConfig

Returns

StateRootSidecarSupervisor

Methods

getStatus()

getStatus(): StateRootSidecarSupervisorStatus

Defined in: chain/state-root-sidecar-supervisor.ts:154

Returns the current supervisor status without exposing process secrets.

Returns

StateRootSidecarSupervisorStatus


leaseExclusiveSidecar()

leaseExclusiveSidecar(): Promise<StateRootSidecarLease>

Defined in: chain/state-root-sidecar-supervisor.ts:206

Acquires the supervised sidecar for a multi-call write sequence.

Returns

Promise<StateRootSidecarLease>


start()

start(): Promise<void>

Defined in: chain/state-root-sidecar-supervisor.ts:113

Evaluates governance/env activation state and starts the sidecar if the configured policy requires it. Active Nervos production boundaries throw on startup failure so the node fails closed.

Returns

Promise<void>


stop()

stop(): Promise<void>

Defined in: chain/state-root-sidecar-supervisor.ts:138

Stops the health loop and sidecar process during node shutdown.

Returns

Promise<void>


withExclusiveSidecar()

withExclusiveSidecar<T>(operation): Promise<T>

Defined in: chain/state-root-sidecar-supervisor.ts:182

Runs a mutation-bearing sidecar operation exclusively.

Health checks use the same sidecar process but block execution must be the only writer. This mutex gives the execution store a stable process while still allowing the supervisor to restart/check health between blocks.

Type Parameters

T

T

Parameters

operation

(sidecar) => Promise<T>

Returns

Promise<T>

Audience-first NOOSChain documentation.