MCPcopy Create free account
hub / github.com/chain/txvm / Store

Interface Store

protocol/protocol.go:99–107  ·  view source on GitHub ↗

Store provides storage for blockchain data: blocks and state tree snapshots. Note, this is different from a state snapshot. A state snapshot provides access to the state at a given point in time -- outputs and issuance memory. The Chain type uses Store to load state from storage and persist validat

Source from the content-addressed store, hash-verified

97// and issuance memory. The Chain type uses Store to load state
98// from storage and persist validated data.
99type Store interface {
100 Height(context.Context) (uint64, error)
101 GetBlock(context.Context, uint64) (*bc.Block, error)
102 LatestSnapshot(context.Context) (*state.Snapshot, error)
103
104 SaveBlock(context.Context, *bc.Block) error
105 FinalizeHeight(context.Context, uint64) error
106 SaveSnapshot(context.Context, *state.Snapshot) error
107}
108
109// Chain provides a complete, minimal blockchain database. It
110// delegates the underlying storage to other objects, and uses

Callers 21

NewChainFunction · 0.65
setStateMethod · 0.65
RecoverMethod · 0.65
TestPersistSnapshotFunction · 0.65
CommitAppliedBlockMethod · 0.65
CommitBlockMethod · 0.65
RecoverMethod · 0.65
GetBlockMethod · 0.65
InitialFunction · 0.65
RecoverMethod · 0.65

Implementers 1

MemStoreprotocol/prottest/memstore/memstore.go

Calls

no outgoing calls

Tested by

no test coverage detected