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

findBy

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>

Find exact matches for a field.

findByBlockHashAndIndex

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

Find a transaction request by block hash and index.

findByHashOrNumber

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

Finds hashes of blocks by hash or number.

findByLargest

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

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

findInRange

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

Find a value in a range.

totalDifficulty

abstract fun totalDifficulty(hash: Hash): UInt256?

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

Inheritors

BlockchainIndex

class BlockchainIndex : BlockchainIndexWriter, BlockchainIndexReader

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