Documentation ¶
Index ¶
- type Config
- type Opt
- type Store
- func (s *Store) BlockByHeight(blockHeight uint64) (block *flowgo.Block, err error)
- func (s *Store) BlockByID(blockID flowgo.Identifier) (block *flowgo.Block, err error)
- func (s *Store) Close() error
- func (s *Store) CollectionByID(colID flowgo.Identifier) (col flowgo.LightCollection, err error)
- func (s *Store) CommitBlock(block flowgo.Block, collections []*flowgo.LightCollection, ...) error
- func (s *Store) EventsByHeight(blockHeight uint64, eventType string) (events []flowgo.Event, err error)
- func (s *Store) InsertCollection(col flowgo.LightCollection) error
- func (s *Store) InsertEvents(blockHeight uint64, events []flowgo.Event) error
- func (s *Store) InsertLedgerDelta(blockHeight uint64, delta delta.Delta) error
- func (s *Store) InsertTransaction(tx flowgo.TransactionBody) error
- func (s *Store) InsertTransactionResult(txID flowgo.Identifier, result types.StorableTransactionResult) error
- func (s *Store) LatestBlock() (block flowgo.Block, err error)
- func (s *Store) LedgerViewByHeight(blockHeight uint64) *delta.View
- func (s *Store) RunValueLogGC(discardRatio float64) error
- func (s *Store) StoreBlock(block *flowgo.Block) error
- func (s *Store) Sync() error
- func (s *Store) TransactionByID(txID flowgo.Identifier) (tx flowgo.TransactionBody, err error)
- func (s *Store) TransactionResultByID(txID flowgo.Identifier) (result types.StorableTransactionResult, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Logger is where Badger system logs will go. Logger badger.Logger // DBPath the path to the database directory. DBPath string // Truncate whether to truncate the write log to remove corrupt data. Truncate bool }
Config defines the configurable parameters of the Badger storage implementation.
type Opt ¶
type Opt func(*Config)
func WithLogger ¶
func WithLogger(logger badger.Logger) Opt
func WithTruncate ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an embedded storage implementation using Badger as the underlying persistent key-value store.
func (*Store) BlockByHeight ¶
func (*Store) Close ¶
Close closes the underlying Badger database. It is necessary to close a Store before exiting to ensure all writes are persisted to disk.
func (*Store) CollectionByID ¶
func (s *Store) CollectionByID(colID flowgo.Identifier) (col flowgo.LightCollection, err error)
func (*Store) CommitBlock ¶
func (s *Store) CommitBlock( block flowgo.Block, collections []*flowgo.LightCollection, transactions map[flowgo.Identifier]*flowgo.TransactionBody, transactionResults map[flowgo.Identifier]*types.StorableTransactionResult, delta delta.Delta, events []flowgo.Event, ) error
func (*Store) EventsByHeight ¶
func (*Store) InsertCollection ¶
func (s *Store) InsertCollection(col flowgo.LightCollection) error
func (*Store) InsertEvents ¶
func (*Store) InsertLedgerDelta ¶
func (*Store) InsertTransaction ¶
func (s *Store) InsertTransaction(tx flowgo.TransactionBody) error
func (*Store) InsertTransactionResult ¶
func (s *Store) InsertTransactionResult(txID flowgo.Identifier, result types.StorableTransactionResult) error
func (*Store) LedgerViewByHeight ¶
func (*Store) RunValueLogGC ¶
func (*Store) TransactionByID ¶
func (s *Store) TransactionByID(txID flowgo.Identifier) (tx flowgo.TransactionBody, err error)
func (*Store) TransactionResultByID ¶
func (s *Store) TransactionResultByID(txID flowgo.Identifier) (result types.StorableTransactionResult, err error)
Click to show internal directories.
Click to hide internal directories.