states

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	// Store a state.
	Store(ctx context.Context, state common.BeaconState) error
	// Get a state. The state is a view of a shared immutable backing.
	// The view is save to mutate (it forks away from the original backing)
	// Returns nil if the state does not exist.
	Get(ctx context.Context, root common.Root) (state common.BeaconState, err error)
	// Remove removes a state from the DB. Removing a state that does not exist is safe.
	Remove(root common.Root) error
	io.Closer
}

type DBStats

type DBStats struct {
	Count     int64
	LastWrite common.Root
}

type MemDB

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

func NewMemDB

func NewMemDB(spec *common.Spec) *MemDB

func (*MemDB) Close added in v0.16.0

func (db *MemDB) Close() error

func (*MemDB) Get

func (db *MemDB) Get(ctx context.Context, root common.Root) (state common.BeaconState, err error)

func (*MemDB) Remove

func (db *MemDB) Remove(root common.Root) error

func (*MemDB) Store

func (db *MemDB) Store(ctx context.Context, state common.BeaconState) error

Jump to

Keyboard shortcuts

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