@ethereumjs/blockchain / EthashConsensus
This class encapsulates Ethash-related consensus functionality when used with the Blockchain class.
• new EthashConsensus()
• _ethash: undefined
| Ethash
• algorithm: ConsensusAlgorithm
• blockchain: undefined
| Blockchain
▸ genesisInit(): Promise
<void
>
Initialize genesis for consensus mechanism
Promise
<void
>
▸ newBlock(): Promise
<void
>
Update consensus on new block
Promise
<void
>
▸ setup(__namedParameters
): Promise
<void
>
Set up consensus mechanism
Name | Type |
---|---|
__namedParameters |
ConsensusOptions |
Promise
<void
>
▸ validateConsensus(block
): Promise
<void
>
Validate block consensus parameters
Name | Type | Description |
---|---|---|
block |
Block |
block to be validated |
Promise
<void
>
▸ validateDifficulty(header
): Promise
<void
>
Checks that the block’s difficulty
matches the canonical difficulty of the parent header.
Name | Type | Description |
---|---|---|
header |
BlockHeader |
header of block to be checked |
Promise
<void
>