Node class final Ledger

A running single validator chain node.

Implemented types
Available extensions

Properties

eventStream → Stream<ChainEvent>

Available on Node, provided by the NodeEvents extension

Every chain event as it happens. The engine hands each event over synchronously inside the node call that caused it; listeners run on the next microtask, after that call has returned, so a listener may call the node again. Listening redirects events from the buffer behind events to this broadcast stream until the node is disposed, which closes it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isReleased → bool
Whether the native handle has already been released.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

accountAddress(Uint8List publicKey) → Uint8List
The 32 byte chain address of a public key.
balance(Uint8List address) → int

Available on Node, provided by the NodeQueries extension

The balance of an address.
blockAt(int height) → Uint8List

Available on Node, provided by the NodeStorage extension

The encoded finalized block at height, 1 based. Throws when absent.
commit({int? timestamp}) → int

Available on Node, provided by the NodeSending extension

Produces the next block and returns its height. timestamp defaults to the new height, a monotone placeholder for callers that do not track time.
credit(Uint8List address, int amount) → void
Credits an address at genesis. Throws once a block has been produced.
dispose() → void
Releases the native node.
drainEvents() → String

Available on Node, provided by the NodeQueries extension

Chain events since the last drain, as a JSON array string.
events() → List<ChainEvent>

Available on Node, provided by the NodeEvents extension

Chain events buffered since the last call, decoded. Returns nothing while eventStream is live, because events then go to the stream.
free() → void
Alias of dispose.
fundAccount(int amount) → Account

Available on Node, provided by the NodeFunding extension

A fresh Ed25519 account credited with amount at genesis. Throws once the first block has been produced.
fundHybridAccount(int amount) → Account

Available on Node, provided by the NodeFunding extension

A fresh hybrid post quantum account credited with amount at genesis.
height() → int

Available on Node, provided by the NodeQueries extension

The chain height.
mempoolSize() → int

Available on Node, provided by the NodeQueries extension

Transactions waiting in the mempool.
metrics() → String

Available on Node, provided by the NodeQueries extension

A Prometheus format metrics snapshot.
metricValues() → Map<String, double>

Available on Node, provided by the NodeViews extension

Prometheus metric values keyed by sample name with its labels verbatim.
newAccount() → Account
A fresh Ed25519 account.
newAccountHybrid() → Account
A fresh hybrid post quantum account; spend it with NodeTransfers.submitTransferHybrid.
nextNonce(Uint8List address) → int

Available on Node, provided by the NodeQueries extension

The nonce the next transfer from address must carry: the committed nonce advanced past every transfer from it still pending in the mempool.
nonce(Uint8List address) → int

Available on Node, provided by the NodeQueries extension

The committed nonce of an address.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
produceBlock(int timestamp) → int
Produces the next block and returns its height.
proveAccount(Uint8List address) → Uint8List

Available on Node, provided by the NodeQueries extension

A state inclusion proof for an address.
saveTo(String path) → Future<void>

Available on Node, provided by the NodeStorage extension

Writes snapshot to path atomically: a sibling temporary file is written and flushed, then renamed over path.
send(Account from, Uint8List to, int amount, {int fee = 0}) → Uint8List

Available on Node, provided by the NodeSending extension

Sends amount from from to the address to. The nonce comes from NodeQueries.nextNonce, so several transfers from one account may be queued before a block. The signature scheme follows the account; hybrid accounts carry no fee. Returns the transaction id.
sendFromStore(KeyStore store, Uint8List from, Uint8List to, int amount, {int fee = 0}) → Uint8List

Available on Node, provided by the NodeSending extension

Sends amount from the key store account at from with the nonce from NodeQueries.nextNonce; the secret never leaves the engine.
sendTo(Account from, Account to, int amount, {int fee = 0}) → Uint8List

Available on Node, provided by the NodeSending extension

send to another account.
snapshot() → Uint8List

Available on Node, provided by the NodeStorage extension

The chain id, the genesis credits and every finalized block with its certificate as one blob. Pending mempool transactions are not included.
stateRoot() → Uint8List

Available on Node, provided by the NodeQueries extension

The 32 byte state root.
submitTransfer(Uint8List secret, Uint8List to, int amount, int nonce) → Uint8List

Available on Node, provided by the NodeTransfers extension

Submits an Ed25519 transfer and returns its transaction id.
submitTransferFee(Uint8List secret, Uint8List to, int amount, int nonce, int fee) → Uint8List

Available on Node, provided by the NodeTransfers extension

Submits a transfer carrying a priority fee.
submitTransferFromStore(KeyStore store, Uint8List from, Uint8List to, int amount, int nonce, {int fee = 0}) → Uint8List

Available on Node, provided by the NodeTransfers extension

Signs a transfer from the store account at from and admits it. The secret never leaves the engine. Returns the transaction id.
submitTransferHybrid(Uint8List secret, Uint8List public, Uint8List to, int amount, int nonce) → Uint8List

Available on Node, provided by the NodeTransfers extension

Submits a hybrid post quantum transfer with the blobs from Node.newAccountHybrid.
submitTx(Uint8List encodedTx) → Uint8List

Available on Node, provided by the NodeTransfers extension

Admits an already signed, encoded transaction, for example from KeyStoreSigning.signTransfer. Returns its transaction id.
toString() → String
A string representation of this object.
inherited
verifyAccountProof(Uint8List proof) → bool

Available on Node, provided by the NodeViews extension

Whether proof from NodeQueries.proveAccount holds under the current state root.

Operators

operator ==(Object other) → bool
The equality operator.
inherited