class BlockchainIndex : BlockchainIndexWriter, BlockchainIndexReader
(source)
A Lucene-backed indexer capable of indexing blocks and block headers.
BlockchainIndex(indexWriter: IndexWriter)
A Lucene-backed indexer capable of indexing blocks and block headers. |
fun findBy(field: BlockHeaderFields, value: Bytes): List<Hash> fun findBy(field: BlockHeaderFields, value: Long): List<Hash> fun findBy(field: BlockHeaderFields, value: Gas): List<Hash> fun findBy(field: BlockHeaderFields, value: UInt256): List<Hash> fun findBy(field: BlockHeaderFields, value: Address): List<Hash> fun findBy(field: BlockHeaderFields, value: Hash): List<Hash> fun findBy(field: TransactionReceiptFields, value: Bytes): List<Hash> fun findBy(field: TransactionReceiptFields, value: Int): List<Hash> fun findBy(field: TransactionReceiptFields, value: Long): List<Hash> fun findBy(field: TransactionReceiptFields, value: Gas): List<Hash> fun findBy(field: TransactionReceiptFields, value: UInt256): List<Hash> fun findBy(field: TransactionReceiptFields, value: Address): List<Hash> fun findBy(field: TransactionReceiptFields, value: Hash): List<Hash>
Find exact matches for a field. |
|
fun findByBlockHashAndIndex(blockHash: Hash, index: Int): Hash?
Find a transaction request by block hash and index. |
|
fun findByHashOrNumber(hashOrNumber: Bytes32): List<Hash>
Finds hashes of blocks by hash or number. |
|
fun findByLargest(field: BlockHeaderFields): Hash? fun findByLargest(field: TransactionReceiptFields): Hash?
Find the hash of the block header with the largest value of a specific block header field |
|
fun findInRange(field: BlockHeaderFields, minValue: UInt256, maxValue: UInt256): List<Hash> fun findInRange(field: TransactionReceiptFields, minValue: UInt256, maxValue: UInt256): List<Hash>
Find a value in a range. |
|
fun index(indexer: (BlockchainIndexWriter) -> Unit): Unit
Provides a function to index elements and committing them. If an exception is thrown in the function, the write is rolled back. |
|
fun indexBlockHeader(blockHeader: BlockHeader): Unit
Indexes a block header. |
|
fun indexTransactionReceipt(txReceipt: TransactionReceipt, txIndex: Int, txHash: Hash, blockHash: Hash): Unit
Indexes a transaction receipt. |
|
fun totalDifficulty(hash: Hash): UInt256?
Retrieves the total difficulty of the block header, if it has been computed. |