ethereumjs-monorepo

@ethereumjs/blockchain / EthashConsensus

Class: EthashConsensus

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

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EthashConsensus()

Defined in

consensus/ethash.ts:16

Properties

_ethash

_ethash: undefined | Ethash

Defined in

consensus/ethash.ts:14


algorithm

algorithm: ConsensusAlgorithm

Implementation of

Consensus.algorithm

Defined in

consensus/ethash.ts:13


blockchain

blockchain: undefined | Blockchain

Defined in

consensus/ethash.ts:12

Methods

genesisInit

genesisInit(): Promise<void>

Initialize genesis for consensus mechanism

Returns

Promise<void>

Implementation of

Consensus.genesisInit

Defined in

consensus/ethash.ts:44


newBlock

newBlock(): Promise<void>

Update consensus on new block

Returns

Promise<void>

Implementation of

Consensus.newBlock

Defined in

consensus/ethash.ts:49


setup

setup(__namedParameters): Promise<void>

Set up consensus mechanism

Parameters

Name Type
__namedParameters ConsensusOptions

Returns

Promise<void>

Implementation of

Consensus.setup

Defined in

consensus/ethash.ts:45


validateConsensus

validateConsensus(block): Promise<void>

Validate block consensus parameters

Parameters

Name Type Description
block Block block to be validated

Returns

Promise<void>

Implementation of

Consensus.validateConsensus

Defined in

consensus/ethash.ts:20


validateDifficulty

validateDifficulty(header): Promise<void>

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

Parameters

Name Type Description
header BlockHeader header of block to be checked

Returns

Promise<void>

Implementation of

Consensus.validateDifficulty

Defined in

consensus/ethash.ts:34