Documentation
¶
Index ¶
- Variables
- func WithConcurrentTransactions(concurrent uint) func(*Config)
- type Config
- type Reader
- func (r *Reader) Collection(collID flow.Identifier) (*flow.LightCollection, error)
- func (r *Reader) CollectionsByHeight(height uint64) ([]flow.Identifier, error)
- func (r *Reader) Commit(height uint64) (flow.StateCommitment, error)
- func (r *Reader) Events(height uint64, types ...flow.EventType) ([]flow.Event, error)
- func (r *Reader) First() (uint64, error)
- func (r *Reader) Guarantee(collID flow.Identifier) (*flow.CollectionGuarantee, error)
- func (r *Reader) Header(height uint64) (*flow.Header, error)
- func (r *Reader) HeightForBlock(blockID flow.Identifier) (uint64, error)
- func (r *Reader) HeightForTransaction(txID flow.Identifier) (uint64, error)
- func (r *Reader) Last() (uint64, error)
- func (r *Reader) Result(txID flow.Identifier) (*flow.TransactionResult, error)
- func (r *Reader) Seal(sealID flow.Identifier) (*flow.Seal, error)
- func (r *Reader) SealsByHeight(height uint64) ([]flow.Identifier, error)
- func (r *Reader) Transaction(txID flow.Identifier) (*flow.TransactionBody, error)
- func (r *Reader) TransactionsByHeight(height uint64) ([]flow.Identifier, error)
- func (r *Reader) Values(height uint64, paths []ledger.Path) ([]ledger.Value, error)
- type Writer
- func (w *Writer) Close() error
- func (w *Writer) Collections(height uint64, collections []*flow.LightCollection) error
- func (w *Writer) Commit(height uint64, commit flow.StateCommitment) error
- func (w *Writer) Events(height uint64, events []flow.Event) error
- func (w *Writer) First(height uint64) error
- func (w *Writer) Guarantees(_ uint64, guarantees []*flow.CollectionGuarantee) error
- func (w *Writer) Header(height uint64, header *flow.Header) error
- func (w *Writer) Height(blockID flow.Identifier, height uint64) error
- func (w *Writer) Last(height uint64) error
- func (w *Writer) Payloads(height uint64, paths []ledger.Path, payloads []*ledger.Payload) error
- func (w *Writer) Results(results []*flow.TransactionResult) error
- func (w *Writer) Seals(height uint64, seals []*flow.Seal) error
- func (w *Writer) Transactions(height uint64, transactions []*flow.TransactionBody) error
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{
ConcurrentTransactions: 16,
}
Functions ¶
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements the `index.Reader` interface on top of the DPS server's Badger database index.
func NewReader ¶
func NewReader(db *badger.DB, lib dps.ReadLibrary) *Reader
NewReader creates a new index reader, using the given database as the underlying state repository. It is recommended to provide a read-only Badger database.
func (*Reader) Collection ¶ added in v1.1.0
func (r *Reader) Collection(collID flow.Identifier) (*flow.LightCollection, error)
Collection returns the collection with the given ID.
func (*Reader) CollectionsByHeight ¶ added in v1.1.0
func (r *Reader) CollectionsByHeight(height uint64) ([]flow.Identifier, error)
CollectionsByHeight returns the collection IDs at the given height.
func (*Reader) Commit ¶
func (r *Reader) Commit(height uint64) (flow.StateCommitment, error)
Commit returns the commitment of the execution state as it was after the execution of the finalized block at the given height.
func (*Reader) Events ¶
Events returns the events of all transactions that were part of the finalized block at the given height. It can optionally filter them by event type; if no event types are given, all events are returned.
func (*Reader) Guarantee ¶ added in v1.1.0
func (r *Reader) Guarantee(collID flow.Identifier) (*flow.CollectionGuarantee, error)
Guarantee returns the guarantee with the given collection ID.
func (*Reader) HeightForBlock ¶
func (r *Reader) HeightForBlock(blockID flow.Identifier) (uint64, error)
func (*Reader) HeightForTransaction ¶ added in v1.1.0
func (r *Reader) HeightForTransaction(txID flow.Identifier) (uint64, error)
func (*Reader) Result ¶ added in v1.1.0
func (r *Reader) Result(txID flow.Identifier) (*flow.TransactionResult, error)
Result returns the transaction result for the given transaction ID.
func (*Reader) SealsByHeight ¶ added in v1.1.0
func (r *Reader) SealsByHeight(height uint64) ([]flow.Identifier, error)
SealsByHeight returns all of the seals that were part of the finalized block at the given height.
func (*Reader) Transaction ¶
func (r *Reader) Transaction(txID flow.Identifier) (*flow.TransactionBody, error)
Transaction returns the transaction with the given ID.
func (*Reader) TransactionsByHeight ¶
func (r *Reader) TransactionsByHeight(height uint64) ([]flow.Identifier, error)
TransactionsByHeight returns the transaction IDs within the block with the given ID.
func (*Reader) Values ¶
Values returns the Ledger values of the execution state at the given paths as they were after the execution of the finalized block at the given height. For compatibility with existing Flow execution node code, a path that is not found within the indexed execution state returns a nil value without error.
type Writer ¶
Writer implements the `index.Writer` interface to write indexing data to an underlying Badger database.
func NewWriter ¶
NewWriter creates a new index writer that writes new indexing data to the given Badger database.
func (*Writer) Collections ¶
func (w *Writer) Collections(height uint64, collections []*flow.LightCollection) error
func (*Writer) Commit ¶
func (w *Writer) Commit(height uint64, commit flow.StateCommitment) error
Commit indexes the given commitment of the execution state as it was after the execution of the finalized block at the given height.
func (*Writer) Events ¶
Events indexes the events, which should represent all events of the finalized block at the given height.
func (*Writer) Guarantees ¶ added in v1.1.0
func (w *Writer) Guarantees(_ uint64, guarantees []*flow.CollectionGuarantee) error
func (*Writer) Height ¶
func (w *Writer) Height(blockID flow.Identifier, height uint64) error
Height indexes the height for the given block ID.
func (*Writer) Payloads ¶
Payloads indexes the given payloads, which should represent a trie update of the execution state contained within the finalized block at the given height.
func (*Writer) Results ¶ added in v1.1.0
func (w *Writer) Results(results []*flow.TransactionResult) error
func (*Writer) Seals ¶ added in v1.1.0
Seals indexes the seals, which should represent all seals in the finalized block at the given height.
func (*Writer) Transactions ¶
func (w *Writer) Transactions(height uint64, transactions []*flow.TransactionBody) error