Skip to content

nooschain v0.1.0


nooschain / node-sync/remote-block-ingestion / insertAndExecuteRemoteBlock

Function: insertAndExecuteRemoteBlock()

insertAndExecuteRemoteBlock(db, block, expectedPreviousHash, localNodeId?, verifiedNodeMembership?, peer?, conflictPolicy?, executionOptions?): Promise<string[]>

Defined in: node-sync/remote-block-ingestion.ts:55

Inserts and executes one remote block inside a transaction.

Existing identical blocks are idempotent. Existing same-height different-hash rows become finalized conflicts. Ciphertext retention is decided by local payload replication policy during execution, not by the remote peer.

The returned string array contains verification issues. The success path returns an empty array; mismatches are raised as SyncConflictError before the transaction can commit.

Parameters

db

Kysely<Database>

block

BlockDto

expectedPreviousHash

string | null

localNodeId?

string

verifiedNodeMembership?

VerifiedNodeMembership

peer?

SyncPeer

conflictPolicy?

ChainConflictPolicy = defaultConflictPolicy

executionOptions?

Pick<BlockExecutionOptions, "instrumentation"> = {}

Returns

Promise<string[]>

Audience-first NOOSChain documentation.