Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressTxsIndexer ¶
type AddressTxsIndexer interface { // Accept is called when [txID] is accepted. // Persists data about [txID] and what balances it changed. // [inputUTXOs] are the UTXOs [txID] consumes. // [outputUTXOs] are the UTXOs [txID] creates. // If the error is non-nil, do not persist [txID] to disk as accepted in the VM Accept( txID ids.ID, inputUTXOs []*djtx.UTXO, outputUTXOs []*djtx.UTXO, ) error // Read returns the IDs of transactions that changed [address]'s balance of [assetID]. // The returned transactions are in order of increasing acceptance time. // The length of the returned slice <= [pageSize]. // [cursor] is the offset to start reading from. Read(address []byte, assetID ids.ID, cursor, pageSize uint64) ([]ids.ID, error) }
AddressTxsIndexer maintains information about which transactions changed the balances of which addresses. This includes both transactions that increase and decrease an address's balance. A transaction is said to change an address's balance if either is true: 1) A UTXO that the transaction consumes was at least partially owned by the address. 2) A UTXO that the transaction produces is at least partially owned by the address.
func NewIndexer ¶
func NewIndexer( db database.Database, log logging.Logger, metricsNamespace string, metricsRegisterer prometheus.Registerer, allowIncompleteIndices bool, ) (AddressTxsIndexer, error)
NewIndexer returns a new AddressTxsIndexer. The returned indexer ignores UTXOs that are not type secp256k1fx.TransferOutput.
func NewNoIndexer ¶
func NewNoIndexer(db database.Database, allowIncomplete bool) (AddressTxsIndexer, error)
Click to show internal directories.
Click to hide internal directories.