store

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Branch    = 0x1
	Extension = 0x2
	Value     = 0x3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StoreDir string
	Disabled bool
	Logger   *logger.SugarLogger
}

Config holds the configuration of a trie store

type NodeBytesWithType

type NodeBytesWithType struct {
	NodeBytes []byte `json:"NodeBytes,omitempty"`
	NodeType  string `json:"NodeType,omitempty"`
}

type Store

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

Store maintains MPTrie nodes and values in backend store

func Open

func Open(c *Config) (*Store, error)

Open opens the store to store MPTrie nodes and values

func (*Store) Close

func (s *Store) Close() error

Close closes the store

func (*Store) CommitChanges

func (s *Store) CommitChanges(blockNum uint64) error

func (*Store) GetNode

func (s *Store) GetNode(nodePtr []byte) (mptrie.TrieNode, error)

func (*Store) GetValue

func (s *Store) GetValue(valuePtr []byte) ([]byte, error)

func (*Store) Height

func (s *Store) Height() (uint64, error)

func (*Store) IsDisabled added in v0.2.7

func (s *Store) IsDisabled() bool

func (*Store) PersistNode

func (s *Store) PersistNode(nodePtr []byte) (bool, error)

func (*Store) PersistValue

func (s *Store) PersistValue(valuePtr []byte) (bool, error)

func (*Store) PutNode

func (s *Store) PutNode(nodePtr []byte, node mptrie.TrieNode) error

func (*Store) PutValue

func (s *Store) PutValue(valuePtr, value []byte) error

func (*Store) RollbackChanges

func (s *Store) RollbackChanges() error

func (*Store) SetDisabled added in v0.2.7

func (s *Store) SetDisabled(disabled bool)

Jump to

Keyboard shortcuts

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