Documentation ¶
Index ¶
- Constants
- func DefaultProofRuntime() (prt *merkle.ProofRuntime)
- func First(st KVStore, start, end []byte) (kv abci.EventAttribute, ok bool)
- func Last(st KVStore, start, end []byte) (kv abci.EventAttribute, ok bool)
- func MultiStoreProofOpDecoder(pop crypto.ProofOp) (merkle.ProofOperator, error)
- func NewBaseKVStore(parent KVStore, storeEvery, numRecent int64, key sdk.StoreKey) *baseKVStore
- func NewBaseMultiStore(db dbm.DB) *baseMultiStore
- func NewCacheKVStore(parent KVStore) *cacheKVStore
- func NewCommitMultiStore(ldb dbm.DB, cdb dbm.DB, cacheDir string) *rootMultiStore
- func NewGasKVStore(gasMeter sdk.GasMeter, gasConfig sdk.GasConfig, parent sdk.KVStore) *gasKVStore
- func NewPrefixStore(parent KVStore, prefix []byte) prefixStore
- func NewlatestStore(parent KVStore, latestKeys []string) *latestStore
- func RequireProof(subpath string) bool
- func SetCommitInfo(db dbm.DB, version int64, info commitInfo)
- func SetLatestVersion(db dbm.DB, version int64)
- type CacheKVStore
- type CacheMap
- type CacheMultiStore
- type CacheWrap
- type CacheWrapper
- type CommitID
- type CommitKVStore
- type CommitMultiStore
- type CommitStore
- type CommitmentOp
- type Committer
- type Gas
- type GasConfig
- type GasMeter
- type IavlStore
- func (st *IavlStore) CacheWrap() CacheWrap
- func (st *IavlStore) CacheWrapWithTrace(w io.Writer, tc TraceContext) CacheWrap
- func (st *IavlStore) Commit() CommitID
- func (st *IavlStore) Delete(key []byte)
- func (st *IavlStore) DeleteVersions(from int64, to int64) error
- func (st *IavlStore) Gas(meter GasMeter, config GasConfig) KVStore
- func (st *IavlStore) Get(key []byte) []byte
- func (st *IavlStore) GetImmutable(version int64) (*IavlStore, error)
- func (st *IavlStore) GetStoreType() StoreType
- func (st *IavlStore) Has(key []byte) (exists bool)
- func (st *IavlStore) Iterator(start, end []byte) Iterator
- func (st *IavlStore) LastCommitID() CommitID
- func (st *IavlStore) Latest(keys []string) KVStore
- func (st *IavlStore) Parent() KVStore
- func (st *IavlStore) Prefix(prefix []byte) KVStore
- func (st *IavlStore) Query(req abci.RequestQuery) (res abci.ResponseQuery)
- func (st *IavlStore) RemoteIterator(start, end []byte) Iterator
- func (st *IavlStore) ReverseIterator(start, end []byte) Iterator
- func (st *IavlStore) Set(key, value []byte)
- func (st *IavlStore) SetPruning(pruning sdk.PruningStrategy)
- func (st *IavlStore) VersionExists(version int64) bool
- type Iterator
- type KVPair
- type KVStore
- type MemoryStore
- func (dsa MemoryStore) CacheWrap() CacheWrap
- func (dsa MemoryStore) CacheWrapWithTrace(w io.Writer, tc TraceContext) CacheWrap
- func (s *MemoryStore) Commit() (id sdk.CommitID)
- func (dsa MemoryStore) Delete(key []byte)
- func (m MemoryStore) Gas(meter GasMeter, config GasConfig) KVStore
- func (dsa MemoryStore) Get(key []byte) []byte
- func (ts MemoryStore) GetStoreType() StoreType
- func (dsa MemoryStore) Has(key []byte) bool
- func (dsa MemoryStore) Iterator(start, end []byte) sdk.Iterator
- func (s MemoryStore) LastCommitID() (id sdk.CommitID)
- func (dsa MemoryStore) Latest(keys []string) KVStore
- func (dsa MemoryStore) Parent() KVStore
- func (dsa MemoryStore) Prefix(prefix []byte) KVStore
- func (dsa MemoryStore) RemoteIterator(start, end []byte) Iterator
- func (dsa MemoryStore) ReverseIterator(start, end []byte) sdk.Iterator
- func (dsa MemoryStore) Set(key, value []byte)
- func (s *MemoryStore) SetPruning(pruning PruningStrategy)
- type MultiStore
- type MultiStoreProof
- type MultiStoreProofOp
- type PruningStrategy
- type Queryable
- type Store
- type StoreKey
- type StoreType
- type TraceContext
- type TraceKVStore
- func (tkv *TraceKVStore) CacheWrap() sdk.CacheWrap
- func (tkv *TraceKVStore) CacheWrapWithTrace(_ io.Writer, _ TraceContext) CacheWrap
- func (tkv *TraceKVStore) Delete(key []byte)
- func (tkv *TraceKVStore) Gas(meter GasMeter, config GasConfig) KVStore
- func (tkv *TraceKVStore) Get(key []byte) []byte
- func (tkv *TraceKVStore) GetStoreType() sdk.StoreType
- func (tkv *TraceKVStore) Has(key []byte) bool
- func (tkv *TraceKVStore) Iterator(start, end []byte) sdk.Iterator
- func (tkv *TraceKVStore) Latest(keys []string) KVStore
- func (tkv *TraceKVStore) Parent() KVStore
- func (tkv *TraceKVStore) Prefix(prefix []byte) KVStore
- func (tkv *TraceKVStore) RemoteIterator(start, end []byte) sdk.Iterator
- func (tkv *TraceKVStore) ReverseIterator(start, end []byte) sdk.Iterator
- func (tkv *TraceKVStore) Set(key []byte, value []byte)
Constants ¶
const ( FlagRunMode = "mode" ModeSingle = "single" ModeMulti = "multi" ModeLight = "light" )
const ( ProofOpIAVLCommitment = "ics23:iavl" ProofOpSimpleMerkleCommitment = "ics23:simple" )
const (
CacheName = "cache"
)
const ProofOpMultiStore = "multistore"
the multi-store proof operation constant value
Variables ¶
This section is empty.
Functions ¶
func DefaultProofRuntime ¶
func DefaultProofRuntime() (prt *merkle.ProofRuntime)
XXX: This should be managed by the rootMultiStore which may want to register more proof ops?
func First ¶
func First(st KVStore, start, end []byte) (kv abci.EventAttribute, ok bool)
Gets the first item.
func Last ¶
func Last(st KVStore, start, end []byte) (kv abci.EventAttribute, ok bool)
Gets the last item. `end` is exclusive.
func MultiStoreProofOpDecoder ¶
func MultiStoreProofOpDecoder(pop crypto.ProofOp) (merkle.ProofOperator, error)
MultiStoreProofOpDecoder returns a multi-store merkle proof operator from a given proof operation.
func NewBaseKVStore ¶
func NewBaseMultiStore ¶
func NewCommitMultiStore ¶
nolint
func NewGasKVStore ¶
NewGasKVStore returns a reference to a new GasKVStore. nolint
func NewPrefixStore ¶
func NewlatestStore ¶
func RequireProof ¶
RequireProof returns whether proof is required for the subpath.
func SetCommitInfo ¶
func SetLatestVersion ¶
Types ¶
type CacheKVStore ¶
type CacheKVStore = types.CacheKVStore
Import cosmos-sdk/types/store.go for convenience. nolint
type CacheMultiStore ¶
type CacheMultiStore = types.CacheMultiStore
Import cosmos-sdk/types/store.go for convenience. nolint
type CacheWrapper ¶
type CacheWrapper = types.CacheWrapper
Import cosmos-sdk/types/store.go for convenience. nolint
type CommitKVStore ¶
type CommitKVStore = types.CommitKVStore
Import cosmos-sdk/types/store.go for convenience. nolint
type CommitMultiStore ¶
type CommitMultiStore = types.CommitMultiStore
Import cosmos-sdk/types/store.go for convenience. nolint
type CommitStore ¶
type CommitStore = types.CommitStore
Import cosmos-sdk/types/store.go for convenience. nolint
func LoadIAVLStore ¶
func LoadIAVLStore(ldb, cdb dbm.DB, id CommitID, pruning sdk.PruningStrategy, key sdk.StoreKey) (CommitStore, error)
load the iavl store
type CommitmentOp ¶
type CommitmentOp struct { Type string Spec *ics23.ProofSpec Key []byte Proof *ics23.CommitmentProof }
func NewIavlCommitmentOp ¶
func NewIavlCommitmentOp(key []byte, proof *ics23.CommitmentProof) CommitmentOp
func NewSimpleMerkleCommitmentOp ¶
func NewSimpleMerkleCommitmentOp(key []byte, proof *ics23.CommitmentProof) CommitmentOp
func (CommitmentOp) ProofOp ¶
func (op CommitmentOp) ProofOp() tmmerkle.ProofOp
ProofOp implements ProofOperator interface and converts a CommitmentOp into a merkle.ProofOp format that can later be decoded by CommitmentOpDecoder back into a CommitmentOp for proof verification
type IavlStore ¶ added in v1.6.8
type IavlStore struct {
// contains filtered or unexported fields
}
iavlStore Implements KVStore and CommitStore.
func (*IavlStore) CacheWrapWithTrace ¶ added in v1.6.8
func (st *IavlStore) CacheWrapWithTrace(w io.Writer, tc TraceContext) CacheWrap
CacheWrapWithTrace implements the Store interface.
func (*IavlStore) DeleteVersions ¶ added in v1.6.8
func (*IavlStore) GetImmutable ¶ added in v1.6.24
GetImmutable returns a reference to a new store backed by an immutable IAVL tree at a specific version (height) without any pruning options. This should be used for querying and iteration only. If the version does not exist or has been pruned, an empty immutable IAVL tree will be used. Any mutable operations executed will result in a panic.
func (*IavlStore) GetStoreType ¶ added in v1.6.8
Implements Store.
func (*IavlStore) LastCommitID ¶ added in v1.6.8
Implements Committer.
func (*IavlStore) Query ¶ added in v1.6.8
func (st *IavlStore) Query(req abci.RequestQuery) (res abci.ResponseQuery)
Query implements ABCI interface, allows queries
by default we will return from (latest height -1), as we will have merkle proofs immediately (header height = data height + 1) If latest-1 is not present, use latest (which must be present) if you care to have the latest data to see a tx results, you must explicitly set the height you want to see
func (*IavlStore) RemoteIterator ¶ added in v1.6.8
Implements KVStore.
func (*IavlStore) ReverseIterator ¶ added in v1.6.8
Implements KVStore.
func (*IavlStore) SetPruning ¶ added in v1.6.8
func (st *IavlStore) SetPruning(pruning sdk.PruningStrategy)
Implements Committer.
func (*IavlStore) VersionExists ¶ added in v1.6.8
VersionExists returns whether or not a given version is stored.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
Store implements an in-memory only KVStore. Entries are persisted between commits and thus between blocks. State in Memory store is not committed as part of app state but maintained privately by each node
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
func (MemoryStore) CacheWrapWithTrace ¶
func (dsa MemoryStore) CacheWrapWithTrace(w io.Writer, tc TraceContext) CacheWrap
CacheWrapWithTrace implements the KVStore interface.
func (*MemoryStore) Commit ¶
func (s *MemoryStore) Commit() (id sdk.CommitID)
func (MemoryStore) LastCommitID ¶
func (s MemoryStore) LastCommitID() (id sdk.CommitID)
func (MemoryStore) RemoteIterator ¶
func (MemoryStore) ReverseIterator ¶
func (*MemoryStore) SetPruning ¶
func (s *MemoryStore) SetPruning(pruning PruningStrategy)
type MultiStore ¶
type MultiStore = types.MultiStore
Import cosmos-sdk/types/store.go for convenience. nolint
type MultiStoreProof ¶
type MultiStoreProof struct {
StoreInfos []storeInfo
}
MultiStoreProof defines a collection of store proofs in a multi-store
func NewMultiStoreProof ¶
func NewMultiStoreProof(storeInfos []storeInfo) *MultiStoreProof
func (*MultiStoreProof) ComputeRootHash ¶
func (proof *MultiStoreProof) ComputeRootHash() []byte
ComputeRootHash returns the root hash for a given multi-store proof.
type MultiStoreProofOp ¶
type MultiStoreProofOp struct { // To encode in ProofOp.Data. Proof *MultiStoreProof `json:"proof"` // contains filtered or unexported fields }
TODO: document
func NewMultiStoreProofOp ¶
func NewMultiStoreProofOp(key []byte, proof *MultiStoreProof) MultiStoreProofOp
func (MultiStoreProofOp) GetKey ¶
func (op MultiStoreProofOp) GetKey() []byte
GetKey returns the types for a multi-store proof operation.
func (MultiStoreProofOp) ProofOp ¶
func (op MultiStoreProofOp) ProofOp() crypto.ProofOp
ProofOp return a merkle proof operation from a given multi-store proof operation.
func (MultiStoreProofOp) Run ¶
func (op MultiStoreProofOp) Run(args [][]byte) ([][]byte, error)
Run executes a multi-store proof operation for a given value. It returns the root hash if the value matches all the store's commitID's hash or an error otherwise.
func (MultiStoreProofOp) String ¶
func (op MultiStoreProofOp) String() string
String implements the Stringer interface for a mult-store proof operation.
type PruningStrategy ¶
type PruningStrategy = types.PruningStrategy
Import cosmos-sdk/types/store.go for convenience. nolint
type TraceContext ¶
type TraceContext = types.TraceContext
Import cosmos-sdk/types/store.go for convenience. nolint
type TraceKVStore ¶
type TraceKVStore struct {
// contains filtered or unexported fields
}
TraceKVStore implements the KVStore interface with tracing enabled. Operations are traced on each collactor KVStore call and written to the underlying io.writer.
TODO: Should we use a buffered writer and implement Commit on TraceKVStore?
func NewTraceKVStore ¶
func NewTraceKVStore(parent sdk.KVStore, writer io.Writer, tc TraceContext) *TraceKVStore
NewTraceKVStore returns a reference to a new traceKVStore given a parent KVStore implementation and a buffered writer.
func (*TraceKVStore) CacheWrap ¶
func (tkv *TraceKVStore) CacheWrap() sdk.CacheWrap
CacheWrap implements the KVStore interface. It panics as a TraceKVStore cannot be cache wrapped.
func (*TraceKVStore) CacheWrapWithTrace ¶
func (tkv *TraceKVStore) CacheWrapWithTrace(_ io.Writer, _ TraceContext) CacheWrap
CacheWrapWithTrace implements the KVStore interface. It panics as a TraceKVStore cannot be cache wrapped.
func (*TraceKVStore) Delete ¶
func (tkv *TraceKVStore) Delete(key []byte)
Delete implements the KVStore interface. It traces a write operation and delegates the Delete call to the parent KVStore.
func (*TraceKVStore) Gas ¶
func (tkv *TraceKVStore) Gas(meter GasMeter, config GasConfig) KVStore
Gas implements the KVStore interface.
func (*TraceKVStore) Get ¶
func (tkv *TraceKVStore) Get(key []byte) []byte
Get implements the KVStore interface. It traces a read operation and delegates a Get call to the parent KVStore.
func (*TraceKVStore) GetStoreType ¶
func (tkv *TraceKVStore) GetStoreType() sdk.StoreType
GetStoreType implements the KVStore interface. It returns the underlying KVStore types.
func (*TraceKVStore) Has ¶
func (tkv *TraceKVStore) Has(key []byte) bool
Has implements the KVStore interface. It delegates the Has call to the parent KVStore.
func (*TraceKVStore) Iterator ¶
func (tkv *TraceKVStore) Iterator(start, end []byte) sdk.Iterator
Iterator implements the KVStore interface. It delegates the Iterator call the to the parent KVStore.
func (*TraceKVStore) Latest ¶
func (tkv *TraceKVStore) Latest(keys []string) KVStore
func (*TraceKVStore) Parent ¶
func (tkv *TraceKVStore) Parent() KVStore
func (*TraceKVStore) Prefix ¶
func (tkv *TraceKVStore) Prefix(prefix []byte) KVStore
Prefix implements the KVStore interface.
func (*TraceKVStore) RemoteIterator ¶
func (tkv *TraceKVStore) RemoteIterator(start, end []byte) sdk.Iterator
func (*TraceKVStore) ReverseIterator ¶
func (tkv *TraceKVStore) ReverseIterator(start, end []byte) sdk.Iterator
ReverseIterator implements the KVStore interface. It delegates the ReverseIterator call the to the parent KVStore.
func (*TraceKVStore) Set ¶
func (tkv *TraceKVStore) Set(key []byte, value []byte)
Set implements the KVStore interface. It traces a write operation and delegates the Set call to the parent KVStore.
Source Files ¶
- baseKVStore.go
- baseMultiStore.go
- cachekvstore.go
- cachemergeiterator.go
- cachemultistore.go
- codec.go
- dbstoreadapter.go
- firstlast.go
- gaskvstore.go
- iavlstore.go
- latestKVStore.go
- memiterator.go
- memorystore.go
- multistoreproof.go
- prefixstore.go
- proof.go
- rootmultistore.go
- tracekvstore.go
- transientstore.go
- wire.go