Skip to content

nooschain v0.1.0


nooschain / consensus/adapters/raft/raft-node / NoosraftEngine

Class: NoosraftEngine

Defined in: consensus/adapters/raft/raft-node.ts:45

Minimal Raft engine for development and integration tests.

The engine guarantees that a proposed NOOSChain block entry is emitted to handlers only after the Raft log index is committed. The handler then applies the block through the normal NOOSChain deterministic executor and can enter incident mode on mismatch.

Implements

Constructors

Constructor

new NoosraftEngine(options): NoosraftEngine

Defined in: consensus/adapters/raft/raft-node.ts:57

Parameters

options

RaftNodeOptions

Returns

NoosraftEngine

Methods

getStatus()

getStatus(): Promise<RaftNodeStatus>

Defined in: consensus/adapters/raft/raft-node.ts:136

Returns role, term, log, commit, and snapshot state for status APIs.

Returns

Promise<RaftNodeStatus>

Implementation of

RaftEngine.getStatus


onCommittedEntry()

onCommittedEntry(handler): void

Defined in: consensus/adapters/raft/raft-node.ts:131

Registers the deterministic NOOSChain block application callback.

Parameters

handler

CommittedRaftEntryHandler

Returns

void

Implementation of

RaftEngine.onCommittedEntry


start()

start(): Promise<void>

Defined in: consensus/adapters/raft/raft-node.ts:66

Loads persisted term/vote/log state, starts the transport, and resumes applying any entries that were committed before a prior shutdown.

Returns

Promise<void>

Implementation of

RaftEngine.start


stop()

stop(): Promise<void>

Defined in: consensus/adapters/raft/raft-node.ts:103

Stops network delivery and timers. Persistent Raft state is left intact so the same node can restart without losing term, vote, or log safety.

Returns

Promise<void>

Implementation of

RaftEngine.stop


submitBlockProposal()

submitBlockProposal(entry): Promise<void>

Defined in: consensus/adapters/raft/raft-node.ts:113

Appends a leader-created NOOSChain block envelope to the local Raft log and waits until the entry is both committed and locally applied.

Parameters

entry

RaftBlockLogEntry

Returns

Promise<void>

Implementation of

RaftEngine.submitBlockProposal

Audience-first NOOSChain documentation.