package
1.9.6
Repository: https://github.com/decred/dcrd.git
Documentation: pkg.go.dev

# README

indexers

Build Status ISC License Doc

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
  • Address-ever-seen (existsaddridx) Index
    • Stores a key with an empty value for every address that has ever existed and was seen by the client

Removed Legacy Indexers

  • Committed Filter (cfindexparentbucket) Index
    • Stores all committed filters and committed filter headers for all blocks in the main chain
  • 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 and Updating

This package is internal and therefore is neither directly installed nor needs to be manually updated.

License

Package indexers is licensed under the copyfree ISC License.

# Functions

DropAddrIndex drops the address index from the provided database if it exists.
DropCfIndex drops the CF index from the provided database if it exists.
DropExistsAddrIndex drops the exists address index from the provided database if it exists.
DropTxIndex drops the transaction index from the provided database if it exists.
NewExistsAddrIndex returns a new instance of an indexer that is used to create a mapping of all addresses ever seen.
NewIndexSubscriber creates a new index subscriber.
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.

# Constants

ConnectNtfn indicates the index notification signals a block connected to the main chain.
DisconnectNtfn indicates the index notification signals a block disconnected from the main chain.
ErrBlockNotOnMainChain indicates the provided block is not on the main chain.
ErrConnectBlock indicates an error indexing a connected block.
ErrDisconnectBlock indicates an error indexing a disconnected block.
ErrFetchSubscription indicates an error fetching an index subscription.
ErrFetchTip indicates an error fetching an index tip.
ErrInterruptRequested indicates an operation was cancelled due to a user-requested interrupt.
ErrInvalidNotificationType indicates an invalid indexer notification type.
ErrMissingNotification indicates a missing index notification.
ErrRemoveSpendDependency indicates a spend dependency removal error.
ErrUnsupportedAddressType indicates an unsupported address type.

# Structs

ExistsAddrIndex implements an "ever seen" address index.
IndexerError identifies an indexer error.
IndexNtfn represents an index notification detailing a block connection or disconnection.
IndexSubscriber subscribes clients for index updates.
IndexSubscription represents a subscription for index updates.
TxIndex implements a transaction by hash index.
TxIndexEntry houses information about an entry in the transaction index.

# Interfaces

ChainQueryer provides a generic interface that is used to provide access to the chain details required by indexes.
IndexDropper provides a method to remove an index from the database.
Indexer defines a generic interface for an indexer.

# Type aliases

AssertError identifies an error that indicates an internal code consistency issue and should be treated as a critical and unrecoverable error.
ErrorKind identifies a kind of error.
IndexNtfnType represents an index notification type.