ethereumjs-monorepo

@ethereumjs/blockchain


@ethereumjs/blockchain / EthashConsensus

Class: EthashConsensus

Defined in: consensus/ethash.ts:18

This class encapsulates Ethash-related consensus functionality when used with the Blockchain class.

Implements

Constructors

Constructor

new EthashConsensus(ethash): EthashConsensus

Defined in: consensus/ethash.ts:26

Parameters

ethash

MinimalEthashInterface

Returns

EthashConsensus

Properties

_ethash

_ethash: MinimalEthashInterface

Defined in: consensus/ethash.ts:21


algorithm

algorithm: ConsensusAlgorithm

Defined in: consensus/ethash.ts:20

Implementation of

Consensus.algorithm


blockchain

blockchain: undefined | Blockchain

Defined in: consensus/ethash.ts:19

Methods

genesisInit()

genesisInit(): Promise<void>

Defined in: consensus/ethash.ts:64

Initialize genesis for consensus mechanism

Returns

Promise<void>

Implementation of

Consensus.genesisInit


newBlock()

newBlock(): Promise<void>

Defined in: consensus/ethash.ts:69

Update consensus on new block

Returns

Promise<void>

Implementation of

Consensus.newBlock


setup()

setup(__namedParameters): Promise<void>

Defined in: consensus/ethash.ts:65

Set up consensus mechanism

Parameters

__namedParameters

ConsensusOptions

Returns

Promise<void>

Implementation of

Consensus.setup


validateConsensus()

validateConsensus(block): Promise<void>

Defined in: consensus/ethash.ts:35

Validate block consensus parameters

Parameters

block

Block

block to be validated

Returns

Promise<void>

Implementation of

Consensus.validateConsensus


validateDifficulty()

validateDifficulty(header): Promise<void>

Defined in: consensus/ethash.ts:50

Checks that the block’s difficulty matches the canonical difficulty of the parent header.

Parameters

BlockHeader

header of block to be checked

Returns

Promise<void>

Implementation of

Consensus.validateDifficulty