Documentation ¶
Index ¶
- func InitAll(metrics module.CacheMetrics, db *badger.DB) *storage.All
- type Blocks
- func (b *Blocks) ByCollectionID(collID flow.Identifier) (*flow.Block, error)
- func (b *Blocks) ByHeight(height uint64) (*flow.Block, error)
- func (b *Blocks) ByID(blockID flow.Identifier) (*flow.Block, error)
- func (b *Blocks) GetLastFullBlockHeight() (uint64, error)
- func (b *Blocks) IndexBlockForCollections(blockID flow.Identifier, collIDs []flow.Identifier) error
- func (b *Blocks) Store(block *flow.Block) error
- func (b *Blocks) StoreTx(block *flow.Block) func(*badger.Txn) error
- func (b *Blocks) UpdateLastFullBlockHeight(height uint64) error
- type Cache
- type ChunkDataPacks
- type Cleaner
- type ClusterBlocks
- type ClusterPayloads
- type Collections
- func (c *Collections) ByID(colID flow.Identifier) (*flow.Collection, error)
- func (c *Collections) LightByID(colID flow.Identifier) (*flow.LightCollection, error)
- func (c *Collections) LightByTransactionID(txID flow.Identifier) (*flow.LightCollection, error)
- func (c *Collections) Remove(colID flow.Identifier) error
- func (c *Collections) Store(collection *flow.Collection) error
- func (c *Collections) StoreLight(collection *flow.LightCollection) error
- func (c *Collections) StoreLightAndIndexByTransaction(collection *flow.LightCollection) error
- type Commits
- type EpochCommits
- type EpochSetups
- type EpochStatuses
- type Events
- func (e *Events) ByBlockID(blockID flow.Identifier) ([]flow.Event, error)
- func (e *Events) ByBlockIDEventType(blockID flow.Identifier, event flow.EventType) ([]flow.Event, error)
- func (e *Events) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) ([]flow.Event, error)
- func (e *Events) Store(blockID flow.Identifier, events []flow.Event) error
- type ExecutionReceipts
- func (r *ExecutionReceipts) ByBlockID(blockID flow.Identifier) (*flow.ExecutionReceipt, error)
- func (r *ExecutionReceipts) ByID(receiptID flow.Identifier) (*flow.ExecutionReceipt, error)
- func (r *ExecutionReceipts) Index(blockID, receiptID flow.Identifier) error
- func (r *ExecutionReceipts) Store(receipt *flow.ExecutionReceipt) error
- type ExecutionResults
- func (r *ExecutionResults) ByBlockID(blockID flow.Identifier) (*flow.ExecutionResult, error)
- func (r *ExecutionResults) ByID(resultID flow.Identifier) (*flow.ExecutionResult, error)
- func (r *ExecutionResults) Index(blockID flow.Identifier, resultID flow.Identifier) error
- func (r *ExecutionResults) Store(result *flow.ExecutionResult) error
- type Guarantees
- type Headers
- func (h *Headers) ByBlockID(blockID flow.Identifier) (*flow.Header, error)
- func (h *Headers) ByHeight(height uint64) (*flow.Header, error)
- func (h *Headers) ByParentID(parentID flow.Identifier) ([]*flow.Header, error)
- func (h *Headers) FindHeaders(filter func(header *flow.Header) bool) ([]flow.Header, error)
- func (h *Headers) Store(header *flow.Header) error
- type Index
- type Payloads
- type Seals
- type TransactionResults
- func (tr *TransactionResults) BatchStore(blockID flow.Identifier, transactionResults []flow.TransactionResult) error
- func (tr *TransactionResults) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) (*flow.TransactionResult, error)
- func (tr *TransactionResults) Store(blockID flow.Identifier, transactionResult *flow.TransactionResult) error
- type Transactions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Blocks ¶
type Blocks struct {
// contains filtered or unexported fields
}
Blocks implements a simple block storage around a badger DB.
func (*Blocks) ByCollectionID ¶
func (*Blocks) GetLastFullBlockHeight ¶
func (*Blocks) IndexBlockForCollections ¶
func (b *Blocks) IndexBlockForCollections(blockID flow.Identifier, collIDs []flow.Identifier) error
func (*Blocks) UpdateLastFullBlockHeight ¶
UpdateLastFullBlockHeight upsert (update or insert) the last full block height
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
type ChunkDataPacks ¶
type ChunkDataPacks struct {
// contains filtered or unexported fields
}
func NewChunkDataPacks ¶
func NewChunkDataPacks(db *badger.DB) *ChunkDataPacks
func (*ChunkDataPacks) ByChunkID ¶
func (ch *ChunkDataPacks) ByChunkID(chunkID flow.Identifier) (*flow.ChunkDataPack, error)
func (*ChunkDataPacks) Remove ¶
func (ch *ChunkDataPacks) Remove(chunkID flow.Identifier) error
func (*ChunkDataPacks) Store ¶
func (ch *ChunkDataPacks) Store(c *flow.ChunkDataPack) error
type Cleaner ¶
type Cleaner struct {
// contains filtered or unexported fields
}
func NewCleaner ¶
func NewCleaner(log zerolog.Logger, db *badger.DB, metrics module.CleanerMetrics, frequency int) *Cleaner
NewCleaner returns a cleaner that runs the badger value log garbage collection once every `frequency` calls if a frequency of zero is passed in, we will not run the GC at all
type ClusterBlocks ¶
type ClusterBlocks struct {
// contains filtered or unexported fields
}
ClusterBlocks implements a simple block storage around a badger DB.
func NewClusterBlocks ¶
func NewClusterBlocks(db *badger.DB, chainID flow.ChainID, headers *Headers, payloads *ClusterPayloads) *ClusterBlocks
func (*ClusterBlocks) ByHeight ¶
func (b *ClusterBlocks) ByHeight(height uint64) (*cluster.Block, error)
func (*ClusterBlocks) ByID ¶
func (b *ClusterBlocks) ByID(blockID flow.Identifier) (*cluster.Block, error)
type ClusterPayloads ¶
type ClusterPayloads struct {
// contains filtered or unexported fields
}
ClusterPayloads implements storage of block payloads for collection node cluster consensus.
func NewClusterPayloads ¶
func NewClusterPayloads(cacheMetrics module.CacheMetrics, db *badger.DB) *ClusterPayloads
func (*ClusterPayloads) ByBlockID ¶
func (cp *ClusterPayloads) ByBlockID(blockID flow.Identifier) (*cluster.Payload, error)
func (*ClusterPayloads) Store ¶
func (cp *ClusterPayloads) Store(blockID flow.Identifier, payload *cluster.Payload) error
type Collections ¶
type Collections struct {
// contains filtered or unexported fields
}
func NewCollections ¶
func NewCollections(db *badger.DB, transactions *Transactions) *Collections
func (*Collections) ByID ¶
func (c *Collections) ByID(colID flow.Identifier) (*flow.Collection, error)
func (*Collections) LightByID ¶
func (c *Collections) LightByID(colID flow.Identifier) (*flow.LightCollection, error)
func (*Collections) LightByTransactionID ¶
func (c *Collections) LightByTransactionID(txID flow.Identifier) (*flow.LightCollection, error)
func (*Collections) Remove ¶
func (c *Collections) Remove(colID flow.Identifier) error
func (*Collections) Store ¶
func (c *Collections) Store(collection *flow.Collection) error
func (*Collections) StoreLight ¶
func (c *Collections) StoreLight(collection *flow.LightCollection) error
func (*Collections) StoreLightAndIndexByTransaction ¶
func (c *Collections) StoreLightAndIndexByTransaction(collection *flow.LightCollection) error
type Commits ¶
type Commits struct {
// contains filtered or unexported fields
}
func NewCommits ¶
func NewCommits(collector module.CacheMetrics, db *badger.DB) *Commits
func (*Commits) ByBlockID ¶
func (c *Commits) ByBlockID(blockID flow.Identifier) (flow.StateCommitment, error)
func (*Commits) Store ¶
func (c *Commits) Store(blockID flow.Identifier, commit flow.StateCommitment) error
type EpochCommits ¶
type EpochCommits struct {
// contains filtered or unexported fields
}
func NewEpochCommits ¶
func NewEpochCommits(collector module.CacheMetrics, db *badger.DB) *EpochCommits
func (*EpochCommits) ByID ¶
func (ec *EpochCommits) ByID(commitID flow.Identifier) (*flow.EpochCommit, error)
func (*EpochCommits) Store ¶
func (ec *EpochCommits) Store(commit *flow.EpochCommit) error
TODO: can we remove this method? Its not contained in the interface.
func (*EpochCommits) StoreTx ¶
func (ec *EpochCommits) StoreTx(commit *flow.EpochCommit) func(tx *badger.Txn) error
type EpochSetups ¶
type EpochSetups struct {
// contains filtered or unexported fields
}
func NewEpochSetups ¶
func NewEpochSetups(collector module.CacheMetrics, db *badger.DB) *EpochSetups
func (*EpochSetups) ByID ¶
func (es *EpochSetups) ByID(setupID flow.Identifier) (*flow.EpochSetup, error)
func (*EpochSetups) StoreTx ¶
func (es *EpochSetups) StoreTx(setup *flow.EpochSetup) func(tx *badger.Txn) error
type EpochStatuses ¶
type EpochStatuses struct {
// contains filtered or unexported fields
}
func NewEpochStatuses ¶
func NewEpochStatuses(collector module.CacheMetrics, db *badger.DB) *EpochStatuses
func (*EpochStatuses) ByBlockID ¶
func (es *EpochStatuses) ByBlockID(blockID flow.Identifier) (*flow.EpochStatus, error)
func (*EpochStatuses) StoreTx ¶
func (es *EpochStatuses) StoreTx(blockID flow.Identifier, status *flow.EpochStatus) func(tx *badger.Txn) error
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
func (*Events) ByBlockIDEventType ¶
func (e *Events) ByBlockIDEventType(blockID flow.Identifier, event flow.EventType) ([]flow.Event, error)
ByBlockIDEventType returns the events for the given block ID and event type
func (*Events) ByBlockIDTransactionID ¶
func (e *Events) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) ([]flow.Event, error)
ByBlockIDTransactionID returns the events for the given block ID and transaction ID
type ExecutionReceipts ¶
type ExecutionReceipts struct {
// contains filtered or unexported fields
}
ExecutionReceipts implements storage for execution receipts.
func NewExecutionReceipts ¶
func NewExecutionReceipts(db *badger.DB, results *ExecutionResults) *ExecutionReceipts
func (*ExecutionReceipts) ByBlockID ¶
func (r *ExecutionReceipts) ByBlockID(blockID flow.Identifier) (*flow.ExecutionReceipt, error)
func (*ExecutionReceipts) ByID ¶
func (r *ExecutionReceipts) ByID(receiptID flow.Identifier) (*flow.ExecutionReceipt, error)
func (*ExecutionReceipts) Index ¶
func (r *ExecutionReceipts) Index(blockID, receiptID flow.Identifier) error
func (*ExecutionReceipts) Store ¶
func (r *ExecutionReceipts) Store(receipt *flow.ExecutionReceipt) error
type ExecutionResults ¶
type ExecutionResults struct {
// contains filtered or unexported fields
}
ExecutionResults implements persistent storage for execution results.
func NewExecutionResults ¶
func NewExecutionResults(db *badger.DB) *ExecutionResults
func (*ExecutionResults) ByBlockID ¶
func (r *ExecutionResults) ByBlockID(blockID flow.Identifier) (*flow.ExecutionResult, error)
func (*ExecutionResults) ByID ¶
func (r *ExecutionResults) ByID(resultID flow.Identifier) (*flow.ExecutionResult, error)
func (*ExecutionResults) Index ¶
func (r *ExecutionResults) Index(blockID flow.Identifier, resultID flow.Identifier) error
func (*ExecutionResults) Store ¶
func (r *ExecutionResults) Store(result *flow.ExecutionResult) error
type Guarantees ¶
type Guarantees struct {
// contains filtered or unexported fields
}
Guarantees implements persistent storage for collection guarantees.
func NewGuarantees ¶
func NewGuarantees(collector module.CacheMetrics, db *badger.DB) *Guarantees
func (*Guarantees) ByCollectionID ¶
func (g *Guarantees) ByCollectionID(collID flow.Identifier) (*flow.CollectionGuarantee, error)
func (*Guarantees) Store ¶
func (g *Guarantees) Store(guarantee *flow.CollectionGuarantee) error
type Headers ¶
type Headers struct {
// contains filtered or unexported fields
}
Headers implements a simple read-only header storage around a badger DB.
func NewHeaders ¶
func NewHeaders(collector module.CacheMetrics, db *badger.DB) *Headers
func (*Headers) ByParentID ¶
func (*Headers) FindHeaders ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index implements a simple read-only payload storage around a badger DB.
func NewIndex ¶
func NewIndex(collector module.CacheMetrics, db *badger.DB) *Index
type Payloads ¶
type Payloads struct {
// contains filtered or unexported fields
}
func NewPayloads ¶
func NewPayloads(db *badger.DB, index *Index, guarantees *Guarantees, seals *Seals) *Payloads
type Seals ¶
type Seals struct {
// contains filtered or unexported fields
}
func NewSeals ¶
func NewSeals(collector module.CacheMetrics, db *badger.DB) *Seals
type TransactionResults ¶
type TransactionResults struct {
// contains filtered or unexported fields
}
func NewTransactionResults ¶
func NewTransactionResults(db *badger.DB) *TransactionResults
func (*TransactionResults) BatchStore ¶
func (tr *TransactionResults) BatchStore(blockID flow.Identifier, transactionResults []flow.TransactionResult) error
BatchStore will store the transaction results for the given block ID
func (*TransactionResults) ByBlockIDTransactionID ¶
func (tr *TransactionResults) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) (*flow.TransactionResult, error)
ByBlockIDTransactionID returns the runtime transaction result for the given block ID and transaction ID
func (*TransactionResults) Store ¶
func (tr *TransactionResults) Store(blockID flow.Identifier, transactionResult *flow.TransactionResult) error
Store will store the transaction result for the given block ID
type Transactions ¶
type Transactions struct {
// contains filtered or unexported fields
}
func NewTransactions ¶
func NewTransactions(cacheMetrics module.CacheMetrics, db *badger.DB) *Transactions
func (*Transactions) ByID ¶
func (t *Transactions) ByID(txID flow.Identifier) (*flow.TransactionBody, error)
func (*Transactions) Store ¶
func (t *Transactions) Store(flowTx *flow.TransactionBody) error
Source Files ¶
- all.go
- blocks.go
- cache.go
- chunkDataPacks.go
- cleaner.go
- cluster_blocks.go
- cluster_payloads.go
- collections.go
- commits.go
- common.go
- epoch_commits.go
- epoch_setups.go
- epoch_statuses.go
- events.go
- guarantees.go
- headers.go
- index.go
- payloads.go
- receipts.go
- results.go
- seals.go
- transaction_results.go
- transactions.go