txdb

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2017 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeMainchain added in v0.1.4

func DecodeMainchain(data []byte) (map[uint64]*bc.Hash, error)

DecodeMainchain decodes a Mainchain from bytes

func DecodeSnapshot

func DecodeSnapshot(data []byte) (*state.Snapshot, error)

DecodeSnapshot decodes a snapshot from bytes

func GetBlock added in v0.1.4

func GetBlock(db dbm.DB, hash *bc.Hash) *legacy.Block

Types

type BlockStoreStateJSON

type BlockStoreStateJSON struct {
	Height uint64
	Hash   *bc.Hash
}

func (BlockStoreStateJSON) Save

func (bsj BlockStoreStateJSON) Save(db dbm.DB)

type Store

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

A Store encapsulates storage for blockchain validation. It satisfies the interface protocol.Store, and provides additional methods for querying current data.

func NewStore

func NewStore(db dbm.DB) *Store

NewStore creates and returns a new Store object.

func (*Store) BlockExist added in v0.1.4

func (s *Store) BlockExist(hash *bc.Hash) bool

func (*Store) GetBlock

func (s *Store) GetBlock(hash *bc.Hash) (*legacy.Block, error)

func (*Store) GetMainchain added in v0.1.4

func (s *Store) GetMainchain(hash *bc.Hash) (map[uint64]*bc.Hash, error)

func (*Store) GetSnapshot

func (s *Store) GetSnapshot(hash *bc.Hash) (*state.Snapshot, error)

func (*Store) GetStoreStatus added in v0.1.4

func (s *Store) GetStoreStatus() BlockStoreStateJSON

func (*Store) SaveBlock

func (s *Store) SaveBlock(block *legacy.Block) error

SaveBlock persists a new block in the database.

func (*Store) SaveMainchain added in v0.1.4

func (s *Store) SaveMainchain(mainchain map[uint64]*bc.Hash, hash *bc.Hash) error

func (*Store) SaveSnapshot

func (s *Store) SaveSnapshot(snapshot *state.Snapshot, hash *bc.Hash) error

SaveSnapshot saves a state snapshot to the database.

func (*Store) SaveStoreStatus added in v0.1.4

func (s *Store) SaveStoreStatus(height uint64, hash *bc.Hash)

Directories

Path Synopsis
internal
storage
Package storage is a generated protocol buffer package.
Package storage is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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