chainstore

package
v2.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store allows to save snapshoted state.

func New

New returns a new Store.

func (*Store) GetLastCheckpoint

func (s *Store) GetLastCheckpoint(v interface{}) (*types.TipSetKey, error)

GetLastCheckpoint returns the most recent saved state, and its TipSetKey. In case none exist, it will return a nil TipSetKey.

func (*Store) LoadAndPrune

func (s *Store) LoadAndPrune(ctx context.Context, currHead types.TipSetKey, value interface{}) (*types.TipSetKey, error)

LoadAndPrune loads into value the last saved state before the currHead tipset branch, and returns the TipSetKey of that state. If currHead invalidates saved checkpoints those will be deleted (auto-pruning).

func (*Store) Save

func (s *Store) Save(ctx context.Context, ts types.TipSetKey, state interface{}) error

Save saves a new current state which should be a child of the last known checkpoint.

type TipsetOrderer

type TipsetOrderer interface {
	Precedes(ctx context.Context, from, to types.TipSetKey) (bool, error)
}

TipsetOrderer resolves ordering information between TipSets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL