tuweni / org.apache.tuweni.eth.repository / BlockchainIndexReader

BlockchainIndexReader

interface BlockchainIndexReader (source)

Reader of a blockchain index.

Allows to query for fields for exact or range matches.

Functions

chainHeadTotalDifficulty

Retrieves the largest total difficulty value of the chain, if it has been computed.

abstract fun chainHeadTotalDifficulty(): UInt256?

findBy

Find exact matches for a field.

abstract fun findBy(field: BlockHeaderFields, value: Bytes): List<Hash>
abstract fun findBy(field: BlockHeaderFields, value: Long): List<Hash>
abstract fun findBy(field: BlockHeaderFields, value: Gas): List<Hash>
abstract fun findBy(field: BlockHeaderFields, value: UInt256): List<Hash>
abstract fun findBy(field: BlockHeaderFields, value: Address): List<Hash>
abstract fun findBy(field: BlockHeaderFields, value: Hash): List<Hash>
abstract fun findBy(field: TransactionReceiptFields, value: Bytes): List<Hash>
abstract fun findBy(field: TransactionReceiptFields, value: Int): List<Hash>
abstract fun findBy(field: TransactionReceiptFields, value: Long): List<Hash>
abstract fun findBy(field: TransactionReceiptFields, value: Gas): List<Hash>
abstract fun findBy(field: TransactionReceiptFields, value: UInt256): List<Hash>
abstract fun findBy(field: TransactionReceiptFields, value: Address): List<Hash>
abstract fun findBy(field: TransactionReceiptFields, value: Hash): List<Hash>

findByBlockHashAndIndex

Find a transaction request by block hash and index.

abstract fun findByBlockHashAndIndex(blockHash: Bytes, index: Int): Hash?

findByHashOrNumber

Finds hashes of blocks by hash or number.

abstract fun findByHashOrNumber(hashOrNumber: Bytes): List<Hash>

findByLargest

Find the hash of the block header with the largest value of a specific block header field

abstract fun findByLargest(field: BlockHeaderFields): Hash?
abstract fun findByLargest(field: TransactionReceiptFields): Hash?

findInRange

Find a value in a range.

abstract fun findInRange(field: BlockHeaderFields, minValue: UInt256, maxValue: UInt256): List<Hash>
abstract fun findInRange(field: TransactionReceiptFields, minValue: UInt256, maxValue: UInt256): List<Hash>

findLargestTotalDifficulty

Find the hash of the block header with the largest total difficulty.

abstract fun findLargestTotalDifficulty(): Hash?

totalDifficulty

Retrieves the total difficulty of the block header, if it has been computed.

abstract fun totalDifficulty(hash: Bytes): UInt256?

Inheritors

BlockchainIndex

A Lucene-backed indexer capable of indexing blocks and block headers.

class BlockchainIndex : BlockchainIndexWriter, BlockchainIndexReader