Documentation
¶
Index ¶
- Variables
- func WithConcurrentTransactions(concurrent uint) func(*Config)
- type Config
- type Reader
- 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) Header(height uint64) (*flow.Header, error)
- func (r *Reader) HeightForBlock(blockID flow.Identifier) (uint64, error)
- func (r *Reader) Last() (uint64, 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) 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) 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) 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) HeightForBlock ¶
func (r *Reader) HeightForBlock(blockID flow.Identifier) (uint64, error)
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) 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) Transactions ¶
func (w *Writer) Transactions(height uint64, transactions []*flow.TransactionBody) error