{"modulePath":"github.com/onflow/flow-archive","version":"v0.31.9-decrease-wait-interval","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package tracker\n\n## Types\n\n```go\ntype Consensus struct {\n\t// contains filtered or unexported fields\n}\n```\nConsensus is the DPS consensus follower, which uses a local protocol state database to retrieve consensus-dependent data, while falling back on an record holder to complement the rest of the data. It provides a callback for the unstaked consensus follower on the Flow network that allows it to update the cached data each time a block is finalized. Consensus implements the \\`Chain\\` interface needed by the DPS indexer.\n\n```go\nfunc NewConsensus(log zerolog.Logger, db *badger.DB, hold RecordHolder) (*Consensus, error)\n```\nNewConsensus returns a new instance of the DPS consensus follower, reading from the provided protocol state database and the provided block record holder.\n\n```go\nfunc (c *Consensus) Collections(height uint64) ([]*flow.LightCollection, error)\n```\nCollections returns the light collections for the finalized block at the given height.\n\n```go\nfunc (c *Consensus) Commit(height uint64) (flow.StateCommitment, error)\n```\nCommit returns the state commitment for the given height, if available.\n\n```go\nfunc (c *Consensus) Events(height uint64) ([]flow.Event, error)\n```\nEvents returns the transaction events for the finalized block at the given height.\n\n```go\nfunc (c *Consensus) Guarantees(height uint64) ([]*flow.CollectionGuarantee, error)\n```\nGuarantees returns the collection guarantees for the given height, if available.\n\n```go\nfunc (c *Consensus) Header(height uint64) (*flow.Header, error)\n```\nHeader returns the header for the given height, if available. Once a header has been successfully retrieved, all block payload data at a height lower than the returned payload are purged from the cache.\n\n```go\nfunc (c *Consensus) OnBlockFinalized(block *model.Block)\n```\nOnBlockFinalized is a callback that notifies the consensus tracker of a new finalized block.\n\n```go\nfunc (c *Consensus) Results(height uint64) ([]*flow.TransactionResult, error)\n```\nResults returns the transaction results for the finalized block at the given height.\n\n```go\nfunc (c *Consensus) Root() (uint64, error)\n```\nRoot returns the root height from the underlying protocol state.\n\n```go\nfunc (c *Consensus) Seals(height uint64) ([]*flow.Seal, error)\n```\nSeals returns the block seals for the given height, if available.\n\n```go\nfunc (c *Consensus) Transactions(height uint64) ([]*flow.TransactionBody, error)\n```\nTransactions returns the transaction bodies for the finalized block at the given height.\n\n```go\ntype Execution struct {\n\t// contains filtered or unexported fields\n}\n```\nExecution is the DPS execution follower, which keeps track of updates to the execution state. It retrieves block records (block data updates) from a streamer and extracts the trie updates for consumers. It also makes the rest of the block record data available for external consumers by block ID.\n\n```go\nfunc NewExecution(log zerolog.Logger, db *badger.DB, stream RecordStreamer) (*Execution, error)\n```\nNewExecution creates a new DPS execution follower, relying on the provided stream of block records (block data updates).\n\n```go\nfunc (e *Execution) AllUpdates() ([]*ledger.TrieUpdate, error)\n```\nAllUpdates provides all trie updates in the execution record of the next block in the queue\n\n```go\nfunc (e *Execution) Record(blockID flow.Identifier) (*uploader.BlockData, error)\n```\nRecord returns the block record for the given block ID, if it is available. Once a block record is returned, all block records at a height lower than the height of the returned record are purged from the cache.\n\n```go\ntype RecordHolder interface {\n\tRecord(blockID flow.Identifier) (*uploader.BlockData, error)\n}\n```\nRecordHolder represents something that can be used to request block data for a specific block identifier.\n\n```go\ntype RecordStreamer interface {\n\tNext() (*uploader.BlockData, error)\n}\n```\nRecordStreamer represents something that can stream block data.\n\n","path":"github.com/onflow/flow-archive/service/tracker","name":"tracker","synopsis":"","isRedistributable":true}
