tuweni / org.apache.tuweni.devp2p.eth / BlockchainInformation

BlockchainInformation

interface BlockchainInformation (source)

Blockchain information to be shared over the network with peers

Functions

bestHash

Best block hash we know

abstract fun bestHash(): Hash

bestNumber

Best block number we know

abstract fun bestNumber(): UInt256

forks

Forks of our network we know

abstract fun forks(): List<Long>

genesisHash

Genesis block hash

abstract fun genesisHash(): Hash

getForkHashes

Get all our fork hashes

open fun getForkHashes(): List<Bytes>

getLatestFork

Get our latest known fork

open fun getLatestFork(): Long?

getLatestForkHash

Get latest fork hash, if known

open fun getLatestForkHash(): Bytes?

networkID

Our network ID. 1 for mainnet.

abstract fun networkID(): UInt256

totalDifficulty

Total difficulty of our canonical chain

abstract fun totalDifficulty(): UInt256

Inheritors

SimpleBlockchainInformation

POJO - constant representation of the blockchain information

data class SimpleBlockchainInformation : BlockchainInformation