Skip to content

nooschain v0.1.0


nooschain / chain/block-builder / buildBlock

Function: buildBlock()

buildBlock(param0): Promise<Block>

Defined in: chain/block-builder.ts:62

Builds a new block by retrieving pending transactions from the mempool, constructing the block header, computing the block hash, and inserting the block and its transactions into the database. The function ensures that the block is created atomically within a database transaction to maintain consistency and integrity of the blockchain data.

Parameters

param0

BuildBlockInput

The input parameters for building the block, including height, previous hash, proposer node ID, maximum transactions, and database instance.

Returns

Promise<Block>

A promise that resolves to the newly created block.

Audience-first NOOSChain documentation.