ethereumjs-monorepo

@ethereumjs/blockchain / Consensus

Interface: Consensus

Interface that a consensus class needs to implement.

Implemented by

Table of contents

Properties

Methods

Properties

algorithm

algorithm: string

Defined in

types.ts:193

Methods

genesisInit

genesisInit(genesisBlock): Promise<void>

Initialize genesis for consensus mechanism

Parameters

Name Type Description
genesisBlock Block genesis block

Returns

Promise<void>

Defined in

types.ts:198


newBlock

newBlock(block, commonAncestor?, ancientHeaders?): Promise<void>

Update consensus on new block

Parameters

Name Type Description
block Block new block
commonAncestor? BlockHeader common ancestor block header (optional)
ancientHeaders? BlockHeader[] array of ancestor block headers (optional)

Returns

Promise<void>

Defined in

types.ts:219


setup

setup(__namedParameters): Promise<void>

Set up consensus mechanism

Parameters

Name Type
__namedParameters ConsensusOptions

Returns

Promise<void>

Defined in

types.ts:203


validateConsensus

validateConsensus(block): Promise<void>

Validate block consensus parameters

Parameters

Name Type Description
block Block block to be validated

Returns

Promise<void>

Defined in

types.ts:209


validateDifficulty

validateDifficulty(header): Promise<void>

Parameters

Name Type
header BlockHeader

Returns

Promise<void>

Defined in

types.ts:211