package
0.23.5
Repository: https://github.com/bitweb-project/bted.git
Documentation: pkg.go.dev

# README

indexers

Build Status ISC License GoDoc

Package indexers implements optional block chain indexes.

These indexes are typically used to enhance the amount of information available via an RPC interface.

Supported Indexers

  • Transaction-by-hash (txbyhashidx) Index
    • Creates a mapping from the hash of each transaction to the block that contains it along with its offset and length within the serialized block
  • Transaction-by-address (txbyaddridx) Index
    • Creates a mapping from every address to all transactions which either credit or debit the address
    • Requires the transaction-by-hash index

Installation

$ go get -u github.com/bitweb-project/bted/blockchain/indexers

License

Package indexers is licensed under the copyfree ISC License.

# Functions

DisableLog disables all library log output.
DropAddrIndex drops the address index from the provided database if it exists.
DropCfIndex drops the CF index from the provided database if exists.
DropTxIndex drops the transaction index from the provided database if it exists.
NewAddrIndex returns a new instance of an indexer that is used to create a mapping of all addresses in the blockchain to the respective transactions that involve them.
NewCfIndex returns a new instance of an indexer that is used to create a mapping of the hashes of all blocks in the blockchain to their respective committed filters.
NewManager returns a new index manager with the provided indexes enabled.
NewTxIndex returns a new instance of an indexer that is used to create a mapping of the hashes of all transactions in the blockchain to the respective block, location within the block, and size of the transaction.
UseLogger uses a specified Logger to output package logging info.

# Structs

AddrIndex implements a transaction by address index.
CfIndex implements a committed filter (cf) by hash index.
Manager defines an index manager that manages multiple optional indexes and implements the blockchain.IndexManager interface so it can be seamlessly plugged into normal chain processing.
TxIndex implements a transaction by hash index.

# Interfaces

Indexer provides a generic interface for an indexer that is managed by an index manager such as the Manager type provided by this package.
NeedsInputser provides a generic interface for an indexer to specify the it requires the ability to look up inputs for a transaction.

# Type aliases

AssertError identifies an error that indicates an internal code consistency issue and should be treated as a critical and unrecoverable error.