Documentation ¶
Index ¶
- Variables
- type MetadataDatabase
- type Options
- type SnapshotsDatabase
- type Tree
- func (t *Tree) AddSnapshot(s *types.Snapshot) error
- func (t *Tree) AddState(key []byte, state []byte)
- func (t *Tree) AsPayloads() ([]*types.Payload, error)
- func (t *Tree) FindImmutableTreeByHeight(blockHeight uint64) (*iavl.ImmutableTree, error)
- func (t *Tree) HasSnapshotsLoaded() bool
- func (t *Tree) Hash() []byte
- func (t *Tree) ListLatestSnapshots(maxLengthOfSnapshotList uint64) ([]*tmtypes.Snapshot, error)
- func (t *Tree) Release()
- func (t *Tree) RemoveKey(key []byte) (bool, error)
- func (t *Tree) SaveVersion() error
- func (t *Tree) WorkingHash() []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDatabasesAreAlreadyInitialized = errors.New("the databases are already initialized") ErrMinimumNumberOfSnapshotsToKeepIs1 = errors.New("the minimum number of snapshots to keep is 1") )
Functions ¶
This section is empty.
Types ¶
type MetadataDatabase ¶
type Options ¶
func StartingAtBlockHeight ¶
func WithInMemoryDatabase ¶
func WithInMemoryDatabase() Options
func WithLevelDBDatabase ¶
type SnapshotsDatabase ¶
type SnapshotsDatabase interface { cometbftdb.DB Clear() error }
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is a high-level structure that abstract the management of the AVL away from the snapshot engine. It ensure the snapshot and metadata databases are in-sync, and old snapshots are removed when exceeding the maximum number to keep configured. When created, it will automatically remove old local snapshots and load the ones left. When the tree is no longer used, the resources it holds must be released by calling Release().
func (*Tree) FindImmutableTreeByHeight ¶
func (t *Tree) FindImmutableTreeByHeight(blockHeight uint64) (*iavl.ImmutableTree, error)
func (*Tree) HasSnapshotsLoaded ¶
func (*Tree) ListLatestSnapshots ¶
func (*Tree) SaveVersion ¶
func (*Tree) WorkingHash ¶
Click to show internal directories.
Click to hide internal directories.