Documentation ¶
Overview ¶
Package indexers implements optional block chain indexes.
Index ¶
- Constants
- func AddIndexSpendConsumers(db database.DB, chain ChainQueryer) error
- func DropAddrIndex(ctx context.Context, db database.DB) error
- func DropCfIndex(ctx context.Context, db database.DB) error
- func DropExistsAddrIndex(ctx context.Context, db database.DB) error
- func DropTxIndex(ctx context.Context, db database.DB) error
- func UseLogger(logger slog.Logger)
- type AddrIndex
- func (idx *AddrIndex) AddUnconfirmedTx(tx *dcrutil.Tx, prevScripts PrevScripter, isTreasuryEnabled bool)
- func (idx *AddrIndex) Create(dbTx database.Tx) error
- func (idx *AddrIndex) DB() database.DB
- func (*AddrIndex) DropIndex(ctx context.Context, db database.DB) error
- func (idx *AddrIndex) EntriesForAddress(dbTx database.Tx, addr stdaddr.Address, numToSkip, numRequested uint32, ...) ([]TxIndexEntry, uint32, error)
- func (idx *AddrIndex) IndexSubscription() *IndexSubscription
- func (idx *AddrIndex) Init(ctx context.Context, chainParams *chaincfg.Params) error
- func (idx *AddrIndex) Key() []byte
- func (idx *AddrIndex) Name() string
- func (idx *AddrIndex) NeedsInputs() bool
- func (idx *AddrIndex) ProcessNotification(dbTx database.Tx, ntfn *IndexNtfn) error
- func (idx *AddrIndex) Queryer() ChainQueryer
- func (idx *AddrIndex) RemoveUnconfirmedTx(hash *chainhash.Hash)
- func (idx *AddrIndex) Subscribers() map[chan bool]struct{}
- func (idx *AddrIndex) Tip() (int64, *chainhash.Hash, error)
- func (idx *AddrIndex) UnconfirmedTxnsForAddress(addr stdaddr.Address) []*dcrutil.Tx
- func (idx *AddrIndex) Version() uint32
- func (idx *AddrIndex) WaitForSync() chan bool
- type AssertError
- type ChainQueryer
- type ErrorKind
- type ExistsAddrIndex
- func (idx *ExistsAddrIndex) AddUnconfirmedTx(tx *wire.MsgTx, isTreasuryEnabled bool)
- func (idx *ExistsAddrIndex) Create(dbTx database.Tx) error
- func (idx *ExistsAddrIndex) DB() database.DB
- func (*ExistsAddrIndex) DropIndex(ctx context.Context, db database.DB) error
- func (idx *ExistsAddrIndex) ExistsAddress(addr stdaddr.Address) (bool, error)
- func (idx *ExistsAddrIndex) ExistsAddresses(addrs []stdaddr.Address) ([]bool, error)
- func (idx *ExistsAddrIndex) IndexSubscription() *IndexSubscription
- func (idx *ExistsAddrIndex) Init(ctx context.Context, chainParams *chaincfg.Params) error
- func (idx *ExistsAddrIndex) Key() []byte
- func (idx *ExistsAddrIndex) Name() string
- func (idx *ExistsAddrIndex) ProcessNotification(dbTx database.Tx, ntfn *IndexNtfn) error
- func (idx *ExistsAddrIndex) Queryer() ChainQueryer
- func (idx *ExistsAddrIndex) Subscribers() map[chan bool]struct{}
- func (idx *ExistsAddrIndex) Tip() (int64, *chainhash.Hash, error)
- func (idx *ExistsAddrIndex) Version() uint32
- func (idx *ExistsAddrIndex) WaitForSync() chan bool
- type IndexDropper
- type IndexNtfn
- type IndexNtfnType
- type IndexSubscriber
- type IndexSubscription
- type Indexer
- type IndexerError
- type NeedsInputser
- type PrevScripter
- type SpendConsumer
- type TxIndex
- func (idx *TxIndex) Create(dbTx database.Tx) error
- func (idx *TxIndex) DB() database.DB
- func (*TxIndex) DropIndex(ctx context.Context, db database.DB) error
- func (idx *TxIndex) Entry(hash *chainhash.Hash) (*TxIndexEntry, error)
- func (idx *TxIndex) IndexSubscription() *IndexSubscription
- func (idx *TxIndex) Init(ctx context.Context, chainParams *chaincfg.Params) error
- func (idx *TxIndex) Key() []byte
- func (idx *TxIndex) Name() string
- func (idx *TxIndex) ProcessNotification(dbTx database.Tx, ntfn *IndexNtfn) error
- func (idx *TxIndex) Queryer() ChainQueryer
- func (idx *TxIndex) Subscribers() map[chan bool]struct{}
- func (idx *TxIndex) Tip() (int64, *chainhash.Hash, error)
- func (idx *TxIndex) Version() uint32
- func (idx *TxIndex) WaitForSync() chan bool
- type TxIndexEntry
Constants ¶
const ( // ErrUnsupportedAddressType indicates an unsupported address type. ErrUnsupportedAddressType = ErrorKind("ErrUnsupportedAddressType") // ErrInvalidSpendConsumerType indicates an invalid spend consumer type. ErrInvalidSpendConsumerType = ErrorKind("ErrInvalidSpendConsumerType") // ErrConnectBlock indicates an error indexing a connected block. ErrConnectBlock = ErrorKind("ErrConnectBlock") // ErrDisconnectBlock indicates an error indexing a disconnected block. ErrDisconnectBlock = ErrorKind("ErrDisconnectBlock") // ErrRemoveSpendDependency indicates a spend dependency removal error. ErrRemoveSpendDependency = ErrorKind("ErrRemoveSpendDependency") // ErrInvalidNotificationType indicates an invalid indexer notification type. ErrInvalidNotificationType = ErrorKind("ErrInvalidNotificationType") // ErrInterruptRequested indicates an operation was cancelled due to // a user-requested interrupt. ErrInterruptRequested = ErrorKind("ErrInterruptRequested") // ErrFetchSubscription indicates an error fetching an index subscription. ErrFetchSubscription = ErrorKind("ErrFetchSubscription") // ErrFetchTip indicates an error fetching an index tip. ErrFetchTip = ErrorKind("ErrFetchTip") // ErrMissingNotification indicates a missing index notification. ErrMissingNotification = ErrorKind("ErrMissingNotification") // ErrBlockNotOnMainChain indicates the provided block is not on the // main chain. ErrBlockNotOnMainChain = ErrorKind("ErrBlockNotOnMainChain") )
These constants are used to identify a specific IndexerError.
Variables ¶
This section is empty.
Functions ¶
func AddIndexSpendConsumers ¶
func AddIndexSpendConsumers(db database.DB, chain ChainQueryer) error
AddIndexSpendConsumers adds spend consumers for applicable optional indexes to the chain queryer.
func DropAddrIndex ¶
DropAddrIndex drops the address index from the provided database if it exists.
func DropCfIndex ¶
DropCfIndex drops the CF index from the provided database if it exists.
func DropExistsAddrIndex ¶
DropExistsAddrIndex drops the exists address index from the provided database if it exists.
func DropTxIndex ¶
DropTxIndex drops the transaction index from the provided database if it exists. Since the address index relies on it, the address index will also be dropped when it exists.
Types ¶
type AddrIndex ¶
type AddrIndex struct {
// contains filtered or unexported fields
}
AddrIndex implements a transaction by address index. That is to say, it supports querying all transactions that reference a given address because they are either crediting or debiting the address. The returned transactions are ordered according to their order of appearance in the blockchain. In other words, first by block height and then by offset inside the block.
In addition, support is provided for a memory-only index of unconfirmed transactions such as those which are kept in the memory pool before inclusion in a block.
func NewAddrIndex ¶
func NewAddrIndex(subscriber *IndexSubscriber, db database.DB, chain ChainQueryer) (*AddrIndex, error)
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.
func (*AddrIndex) AddUnconfirmedTx ¶
func (idx *AddrIndex) AddUnconfirmedTx(tx *dcrutil.Tx, prevScripts PrevScripter, isTreasuryEnabled bool)
AddUnconfirmedTx adds all addresses related to the transaction to the unconfirmed (memory-only) address index.
NOTE: This transaction MUST have already been validated by the memory pool before calling this function with it and have all of the inputs available via the provided previous scripter interface. Failure to do so could result in some or all addresses not being indexed.
This function is safe for concurrent access.
func (*AddrIndex) Create ¶
Create is invoked when the index is created for the first time. It creates the bucket for the address index.
This is part of the Indexer interface.
func (*AddrIndex) DB ¶
func (idx *AddrIndex) DB() database.DB
DB returns the database of the index.
This is part of the Indexer interface.
func (*AddrIndex) DropIndex ¶
DropIndex drops the address index from the provided database if it exists.
func (*AddrIndex) EntriesForAddress ¶
func (idx *AddrIndex) EntriesForAddress(dbTx database.Tx, addr stdaddr.Address, numToSkip, numRequested uint32, reverse bool) ([]TxIndexEntry, uint32, error)
EntriesForAddress returns a slice of details which identify each transaction, including a block region, that involves the passed address according to the specified number to skip, number requested, and whether or not the results should be reversed. It also returns the number actually skipped since it could be less in the case where there are not enough entries.
NOTE: These results only include transactions confirmed in blocks. See the UnconfirmedTxnsForAddress method for obtaining unconfirmed transactions that involve a given address.
This function is safe for concurrent access.
func (*AddrIndex) IndexSubscription ¶
func (idx *AddrIndex) IndexSubscription() *IndexSubscription
IndexSubscription returns the subscription for index updates.
This is part of the Indexer interface.
func (*AddrIndex) Init ¶
Init creates a transaction by address index. In particular, it maintains a map of transactions and their associated addresses via a stream of updates on connected and disconnected blocks.
This is part of the Indexer interface.
func (*AddrIndex) Key ¶
Key returns the database key to use for the index as a byte slice.
This is part of the Indexer interface.
func (*AddrIndex) Name ¶
Name returns the human-readable name of the index.
This is part of the Indexer interface.
func (*AddrIndex) NeedsInputs ¶
NeedsInputs signals that the index requires the referenced inputs in order to properly create the index.
This implements the NeedsInputser interface.
func (*AddrIndex) ProcessNotification ¶
ProcessNotification indexes the provided notification based on its notification type.
This is part of the Indexer interface.
func (*AddrIndex) Queryer ¶
func (idx *AddrIndex) Queryer() ChainQueryer
Queryer returns the chain queryer.
This is part of the Indexer interface.
func (*AddrIndex) RemoveUnconfirmedTx ¶
RemoveUnconfirmedTx removes the passed transaction from the unconfirmed (memory-only) address index.
This function is safe for concurrent access.
func (*AddrIndex) Subscribers ¶
Subscribers returns all client channels waiting for the next index update.
This is part of the Indexer interface.
func (*AddrIndex) Tip ¶
Tip returns the current tip of the index.
This is part of the Indexer interface.
func (*AddrIndex) UnconfirmedTxnsForAddress ¶
UnconfirmedTxnsForAddress returns all transactions currently in the unconfirmed (memory-only) address index that involve the passed address. Unsupported address types are ignored and will result in no results.
This function is safe for concurrent access.
func (*AddrIndex) Version ¶
Version returns the current version of the index.
This is part of the Indexer interface.
func (*AddrIndex) WaitForSync ¶
WaitForSync subscribes clients for the next index sync update.
This is part of the Indexer interface.
type AssertError ¶
type AssertError string
AssertError identifies an error that indicates an internal code consistency issue and should be treated as a critical and unrecoverable error.
func (AssertError) Error ¶
func (e AssertError) Error() string
Error returns the assertion error as a huma-readable string and satisfies the error interface.
type ChainQueryer ¶
type ChainQueryer interface { // MainChainHasBlock returns whether or not the block with the given hash is // in the main chain. MainChainHasBlock(*chainhash.Hash) bool // ChainParams returns the network parameters of the chain. ChainParams() *chaincfg.Params // Best returns the height and hash of the current best block. Best() (int64, *chainhash.Hash) // BlockHeaderByHash returns the block header identified by the given hash. BlockHeaderByHash(hash *chainhash.Hash) (wire.BlockHeader, error) // BlockHashByHeight returns the hash of the block at the given height in // the main chain. BlockHashByHeight(int64) (*chainhash.Hash, error) // BlockHeightByHash returns the height of the block with the given hash // in the main chain. BlockHeightByHash(hash *chainhash.Hash) (int64, error) // BlockByHash returns the block of the provided hash. BlockByHash(*chainhash.Hash) (*dcrutil.Block, error) // Ancestor returns the ancestor of the provided block at the // provided height. Ancestor(block *chainhash.Hash, height int64) *chainhash.Hash // AddSpendConsumer adds the provided spend consumer. AddSpendConsumer(consumer spendpruner.SpendConsumer) // RemoveSpendConsumerDependency removes the provided spend consumer // dependency associated with the provided block hash. RemoveSpendConsumerDependency(dbTx database.Tx, blockHash *chainhash.Hash, consumerID string) error // FetchSpendConsumer returns the spend journal consumer associated with // the provided id. FetchSpendConsumer(id string) (spendpruner.SpendConsumer, error) // PrevScripts returns a source of previous transaction scripts and their // associated versions spent by the given block. PrevScripts(database.Tx, *dcrutil.Block) (PrevScripter, error) // IsTreasuryAgendaActive returns true if the treasury agenda is active at // the provided block. IsTreasuryAgendaActive(*chainhash.Hash) (bool, error) }
ChainQueryer provides a generic interface that is used to provide access to the chain details required by indexes.
All functions MUST be safe for concurrent access.
type ErrorKind ¶
type ErrorKind string
ErrorKind identifies a kind of error. It has full support for errors.Is and errors.As, so the caller can directly check against an error kind when determining the reason for an error.
type ExistsAddrIndex ¶
type ExistsAddrIndex struct {
// contains filtered or unexported fields
}
ExistsAddrIndex implements an "ever seen" address index. Any address that is ever seen in a block or in the mempool is stored here as a key. Values are empty. Once an address is seen, it is never removed from this store. This results in a local version of this database that is consistent only for this peer, but at minimum contains all the addresses seen on the blockchain itself.
In addition, support is provided for a memory-only index of unconfirmed transactions such as those which are kept in the memory pool before inclusion in a block.
func NewExistsAddrIndex ¶
func NewExistsAddrIndex(subscriber *IndexSubscriber, db database.DB, chain ChainQueryer) (*ExistsAddrIndex, error)
NewExistsAddrIndex returns a new instance of an indexer that is used to create a mapping of all addresses ever seen.
func (*ExistsAddrIndex) AddUnconfirmedTx ¶
func (idx *ExistsAddrIndex) AddUnconfirmedTx(tx *wire.MsgTx, isTreasuryEnabled bool)
AddUnconfirmedTx adds all addresses related to the transaction to the unconfirmed (memory-only) exists address index.
This function is safe for concurrent access.
func (*ExistsAddrIndex) Create ¶
func (idx *ExistsAddrIndex) Create(dbTx database.Tx) error
Create is invoked when the index is created for the first time. It creates the bucket for the address index.
This is part of the Indexer interface.
func (*ExistsAddrIndex) DB ¶
func (idx *ExistsAddrIndex) DB() database.DB
DB returns the database of the index.
This is part of the Indexer interface.
func (*ExistsAddrIndex) DropIndex ¶
func (*ExistsAddrIndex) DropIndex(ctx context.Context, db database.DB) error
DropIndex drops the exists address index from the provided database if it exists.
func (*ExistsAddrIndex) ExistsAddress ¶
func (idx *ExistsAddrIndex) ExistsAddress(addr stdaddr.Address) (bool, error)
ExistsAddress is the concurrency safe, exported function that returns whether or not an address has been seen before.
func (*ExistsAddrIndex) ExistsAddresses ¶
func (idx *ExistsAddrIndex) ExistsAddresses(addrs []stdaddr.Address) ([]bool, error)
ExistsAddresses is the concurrency safe, exported function that returns whether or not each address in a slice of addresses has been seen before.
func (*ExistsAddrIndex) IndexSubscription ¶
func (idx *ExistsAddrIndex) IndexSubscription() *IndexSubscription
IndexSubscription returns the subscription for index updates.
This is part of the Indexer interface.
func (*ExistsAddrIndex) Init ¶
func (idx *ExistsAddrIndex) Init(ctx context.Context, chainParams *chaincfg.Params) error
Init initializes the exists address transaction index.
This is part of the Indexer interface.
func (*ExistsAddrIndex) Key ¶
func (idx *ExistsAddrIndex) Key() []byte
Key returns the database key to use for the index as a byte slice.
This is part of the Indexer interface.
func (*ExistsAddrIndex) Name ¶
func (idx *ExistsAddrIndex) Name() string
Name returns the human-readable name of the index.
This is part of the Indexer interface.
func (*ExistsAddrIndex) ProcessNotification ¶
func (idx *ExistsAddrIndex) ProcessNotification(dbTx database.Tx, ntfn *IndexNtfn) error
ProcessNotification indexes the provided notification based on its notification type.
This is part of the Indexer interface.
func (*ExistsAddrIndex) Queryer ¶
func (idx *ExistsAddrIndex) Queryer() ChainQueryer
Queryer returns the chain queryer.
This is part of the Indexer interface.
func (*ExistsAddrIndex) Subscribers ¶
func (idx *ExistsAddrIndex) Subscribers() map[chan bool]struct{}
Subscribers returns all client channels waiting for the next index update.
This is part of the Indexer interface.
func (*ExistsAddrIndex) Tip ¶
func (idx *ExistsAddrIndex) Tip() (int64, *chainhash.Hash, error)
Tip returns the current tip of the index.
This is part of the Indexer interface.
func (*ExistsAddrIndex) Version ¶
func (idx *ExistsAddrIndex) Version() uint32
Version returns the current version of the index.
This is part of the Indexer interface.
func (*ExistsAddrIndex) WaitForSync ¶
func (idx *ExistsAddrIndex) WaitForSync() chan bool
WaitForSync subscribes clients for the next index sync update.
This is part of the Indexer interface.
type IndexDropper ¶
IndexDropper provides a method to remove an index from the database. Indexers may implement this for a more efficient way of deleting themselves from the database rather than simply dropping a bucket.
type IndexNtfn ¶
type IndexNtfn struct { NtfnType IndexNtfnType Block *dcrutil.Block Parent *dcrutil.Block PrevScripts PrevScripter IsTreasuryEnabled bool Done chan bool }
IndexNtfn represents an index notification detailing a block connection or disconnection.
type IndexNtfnType ¶
type IndexNtfnType int
IndexNtfnType represents an index notification type.
const ( // ConnectNtfn indicates the index notification signals a block // connected to the main chain. ConnectNtfn IndexNtfnType = iota // DisconnectNtfn indicates the index notification signals a block // disconnected from the main chain. DisconnectNtfn )
type IndexSubscriber ¶
type IndexSubscriber struct {
// contains filtered or unexported fields
}
IndexSubscriber subscribes clients for index updates.
func NewIndexSubscriber ¶
func NewIndexSubscriber(sCtx context.Context) *IndexSubscriber
NewIndexSubscriber creates a new index subscriber. It also starts the handler for incoming index update subscriptions.
func (*IndexSubscriber) CatchUp ¶
func (s *IndexSubscriber) CatchUp(ctx context.Context, db database.DB, queryer ChainQueryer) error
CatchUp syncs all subscribed indexes to the main chain by connecting blocks from after the lowest index tip to the current main chain tip.
This should be called after all indexes have subscribed for updates.
func (*IndexSubscriber) Notify ¶
func (s *IndexSubscriber) Notify(ntfn *IndexNtfn)
Notify relays an index notification to subscribed indexes for processing.
func (*IndexSubscriber) Run ¶
func (s *IndexSubscriber) Run(ctx context.Context)
Run relays index notifications to subscribed indexes.
This should be run as a goroutine.
func (*IndexSubscriber) Subscribe ¶
func (s *IndexSubscriber) Subscribe(index Indexer, prerequisite string) (*IndexSubscription, error)
Subscribe subscribes an index for updates. The returned index subscription has functions to retrieve a channel that produces a stream of index updates and to stop the stream when the caller no longer wishes to receive updates.
type IndexSubscription ¶
type IndexSubscription struct {
// contains filtered or unexported fields
}
IndexSubscription represents a subscription for index updates.
type Indexer ¶
type Indexer interface { // Key returns the key of the index as a byte slice. Key() []byte // Name returns the human-readable name of the index. Name() string // Version returns the current version of the index. Version() uint32 // DB returns the database of the index. DB() database.DB // Queryer returns the chain queryer. Queryer() ChainQueryer // Tip returns the current index tip. Tip() (int64, *chainhash.Hash, error) // Create is invoked when the indexer is being created. Create(dbTx database.Tx) error // Init is invoked when the index is being initialized. // This differs from the Create method in that it is called on // every load, including the case the index was just created. Init(ctx context.Context, chainParams *chaincfg.Params) error // ProcessNotification indexes the provided notification based on its // notification type. ProcessNotification(dbTx database.Tx, ntfn *IndexNtfn) error // IndexSubscription returns the subscription for index updates. IndexSubscription() *IndexSubscription // WaitForSync subscribes clients for the next index sync update. WaitForSync() chan bool // Subscribers returns all client channels waiting for the next index update. Subscribers() map[chan bool]struct{} }
Indexer defines a generic interface for an indexer.
type IndexerError ¶
IndexerError identifies an indexer error. It has full support for errors.Is and errors.As, so the caller can ascertain the specific reason for the error by checking the underlying error.
func (IndexerError) Error ¶
func (e IndexerError) Error() string
Error satisfies the error interface and prints human-readable errors.
func (IndexerError) Unwrap ¶
func (e IndexerError) Unwrap() error
Unwrap returns the underlying wrapped error.
type NeedsInputser ¶
type NeedsInputser interface {
NeedsInputs() bool
}
NeedsInputser provides a generic interface for an indexer to specify the it requires the ability to look up inputs for a transaction.
type PrevScripter ¶
PrevScripter defines an interface that provides access to scripts and their associated version keyed by an outpoint. It is used within this package as a generic means to provide the scripts referenced by the inputs to transactions within a block that are needed to index it. The boolean return indicates whether or not the script and version for the provided outpoint was found.
type SpendConsumer ¶
type SpendConsumer struct {
// contains filtered or unexported fields
}
SpendConsumer represents an indexer dependent on spend journal entries.
func NewSpendConsumer ¶
func NewSpendConsumer(id string, tipHash *chainhash.Hash, queryer ChainQueryer) *SpendConsumer
NewSpendConsumer initializes a spend consumer.
func (*SpendConsumer) ID ¶
func (s *SpendConsumer) ID() string
ID returns the identifier of the consumer.
func (*SpendConsumer) NeedSpendData ¶
func (s *SpendConsumer) NeedSpendData(hash *chainhash.Hash) (bool, error)
NeedSpendData checks whether the associated spend journal entry for the provided block hash will be needed by the indexer.
func (*SpendConsumer) UpdateTip ¶
func (s *SpendConsumer) UpdateTip(hash *chainhash.Hash)
UpdateTip sets the tip of the consumer to the provided hash.
type TxIndex ¶
type TxIndex struct {
// contains filtered or unexported fields
}
TxIndex implements a transaction by hash index. That is to say, it supports querying all transactions by their hash.
func NewTxIndex ¶
func NewTxIndex(subscriber *IndexSubscriber, db database.DB, chain ChainQueryer) (*TxIndex, error)
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.
func (*TxIndex) Create ¶
Create is invoked when the index is created for the first time. It creates the buckets for the hash-based transaction index and the internal block ID indexes.
This is part of the Indexer interface.
func (*TxIndex) DB ¶
func (idx *TxIndex) DB() database.DB
DB returns the database of the index.
This is part of the Indexer interface.
func (*TxIndex) DropIndex ¶
DropIndex drops the transaction index from the provided database if it exists. Since the address index relies on it, the address index will also be dropped when it exists.
func (*TxIndex) Entry ¶
func (idx *TxIndex) Entry(hash *chainhash.Hash) (*TxIndexEntry, error)
Entry returns details for the provided transaction hash from the transaction index. The block region contained in the result can in turn be used to load the raw transaction bytes. When there is no entry for the provided hash, nil will be returned for the both the entry and the error.
This function is safe for concurrent access.
func (*TxIndex) IndexSubscription ¶
func (idx *TxIndex) IndexSubscription() *IndexSubscription
IndexSubscription returns the subscription for index updates.
This is part of the Indexer interface.
func (*TxIndex) Init ¶
Init initializes the hash-based transaction index. In particular, it finds the highest used block ID and stores it for later use when connecting or disconnecting blocks.
This is part of the Indexer interface.
func (*TxIndex) Key ¶
Key returns the database key to use for the index as a byte slice.
This is part of the Indexer interface.
func (*TxIndex) Name ¶
Name returns the human-readable name of the index.
This is part of the Indexer interface.
func (*TxIndex) ProcessNotification ¶
ProcessNotification indexes the provided notification based on its notification type.
This is part of the Indexer interface.
func (*TxIndex) Queryer ¶
func (idx *TxIndex) Queryer() ChainQueryer
Queryer returns the chain queryer.
This is part of the Indexer interface.
func (*TxIndex) Subscribers ¶
Subscribers returns all client channels waiting for the next index update.
This is part of the Indexer interface.
func (*TxIndex) Tip ¶
Tip returns the current tip of the index.
This is part of the Indexer interface.
func (*TxIndex) Version ¶
Version returns the current version of the index.
This is part of the Indexer interface.
func (*TxIndex) WaitForSync ¶
WaitForSync subscribes clients for the next index sync update.
This is part of the Indexer interface.
type TxIndexEntry ¶
type TxIndexEntry struct { // BlockRegion specifies the location of the raw bytes of the transaction. BlockRegion database.BlockRegion // BlockIndex species the index of the transaction within the array of // transactions that comprise a tree of the block. BlockIndex uint32 }
TxIndexEntry houses information about an entry in the transaction index.