nooschain / consensus/adapters/raft/raft-adapter / RaftConsensusAdapter
Class: RaftConsensusAdapter
Defined in: consensus/adapters/raft/raft-adapter.ts:74
Consensus adapter for both Noosraft and the HashiCorp Go sidecar engine.
The replaceability boundary is RaftEngine: this class never inspects a HashiCorp or Noosraft log directly. It only submits NOOSChain block envelopes and receives committed envelopes back for deterministic local execution.
Implements
Constructors
Constructor
new RaftConsensusAdapter(
config,deps,engine?):RaftConsensusAdapter
Defined in: consensus/adapters/raft/raft-adapter.ts:88
Parameters
config
deps
engine?
Returns
RaftConsensusAdapter
Properties
mode
readonlymode:"raft"
Defined in: consensus/adapters/raft/raft-adapter.ts:75
Implementation of
Methods
getStatus()
getStatus():
Promise<ConsensusStatus>
Defined in: consensus/adapters/raft/raft-adapter.ts:396
Combines engine status with the local chain head so callers can see both consensus runtime state and deterministic NOOSChain application progress.
Returns
Promise<ConsensusStatus>
Implementation of
onCommittedBlock()
onCommittedBlock(
handler):void
Defined in: consensus/adapters/raft/raft-adapter.ts:523
Registers listeners that run after a committed block is locally applied.
Parameters
handler
(block) => Promise<void>
Returns
void
Implementation of
ConsensusAdapter.onCommittedBlock
proposeBlock()
proposeBlock():
Promise<ConsensusCommittedBlock|null>
Defined in: consensus/adapters/raft/raft-adapter.ts:492
Builds a candidate block from the leader's mempool and submits it to Raft. The block is returned only after the engine commits it and the local executor has persisted the canonical block.
Returns
Promise<ConsensusCommittedBlock | null>
Implementation of
receiveExternalRaftCommittedEntry()
receiveExternalRaftCommittedEntry(
entry):Promise<void>
Defined in: consensus/adapters/raft/raft-adapter.ts:536
Entry point for authenticated committed-entry callbacks from a sidecar.
Parameters
entry
Returns
Promise<void>
receiveRaftMessage()
receiveRaftMessage(
message):Promise<void>
Defined in: consensus/adapters/raft/raft-adapter.ts:528
Entry point for authenticated HTTP Raft transport messages.
Parameters
message
Returns
Promise<void>
start()
start():
Promise<void>
Defined in: consensus/adapters/raft/raft-adapter.ts:348
Starts the selected Raft engine and marks the adapter running.
Returns
Promise<void>
Implementation of
stop()
stop():
Promise<void>
Defined in: consensus/adapters/raft/raft-adapter.ts:381
Stops the selected Raft engine without rewriting committed chain state.
Returns
Promise<void>
Implementation of
submitTransaction()
submitTransaction(
transactionHash):Promise<SubmitTxResult>
Defined in: consensus/adapters/raft/raft-adapter.ts:457
Accepts transaction hashes only on the current leader and only when the transaction is already persisted as pending in the local mempool.
Parameters
transactionHash
string
Returns
Promise<SubmitTxResult>