Documentation ¶
Index ¶
- func DefaultProofRuntime() (prt *merkle.ProofRuntime)
- func GetLatestVersion(db dbm.DB) int64
- func RequireProof(subpath string) bool
- type Store
- func (rs *Store) AddListeners(key types.StoreKey, listeners []types.WriteListener)
- func (rs *Store) CacheMultiStore() types.CacheMultiStore
- func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)
- func (rs *Store) CacheWrap() types.CacheWrap
- func (rs *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap
- func (rs *Store) Commit() types.CommitID
- func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore
- func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore
- func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore
- func (rs *Store) GetPruning() pruningtypes.PruningOptions
- func (rs *Store) GetStore(key types.StoreKey) types.Store
- func (rs *Store) GetStoreByName(name string) types.Store
- func (rs *Store) GetStoreType() types.StoreType
- func (rs *Store) LastCommitID() types.CommitID
- func (rs *Store) LatestVersion() int64
- func (rs *Store) ListeningEnabled(key types.StoreKey) bool
- func (rs *Store) LoadLatestVersion() error
- func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) error
- func (rs *Store) LoadVersion(ver int64) error
- func (rs *Store) LoadVersionAndUpgrade(ver int64, upgrades *types.StoreUpgrades) error
- func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db dbm.DB)
- func (rs *Store) PruneSnapshotHeight(height int64)
- func (rs *Store) PruneStores(clearPruningManager bool, pruningHeights []int64) (err error)
- func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery
- func (rs *Store) Restore(height uint64, format uint32, protoReader protoio.Reader) (snapshottypes.SnapshotItem, error)
- func (rs *Store) RollbackToVersion(target int64) error
- func (rs *Store) SetIAVLCacheSize(cacheSize int)
- func (rs *Store) SetIAVLDisableFastNode(disableFastNode bool)
- func (rs *Store) SetInitialVersion(version int64) error
- func (rs *Store) SetInterBlockCache(c types.MultiStorePersistentCache)
- func (rs *Store) SetLazyLoading(lazyLoading bool)
- func (rs *Store) SetMetrics(metrics metrics.StoreMetrics)
- func (rs *Store) SetPruning(pruningOpts pruningtypes.PruningOptions)
- func (rs *Store) SetSnapshotInterval(snapshotInterval uint64)
- func (rs *Store) SetTracer(w io.Writer) types.MultiStore
- func (rs *Store) SetTracingContext(tc types.TraceContext) types.MultiStore
- func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error
- func (rs *Store) StoreKeysByName() map[string]types.StoreKey
- func (rs *Store) TracingEnabled() bool
Constants ¶
This section is empty.
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 GetLatestVersion ¶
func RequireProof ¶
RequireProof returns whether proof is required for the subpath.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is composed of many CommitStores. Name contrasts with cacheMultiStore which is used for branching other MultiStores. It implements the CommitMultiStore interface.
func NewStore ¶
NewStore returns a reference to a new Store object with the provided DB. The store will be created with a PruneNothing pruning strategy by default. After a store is created, KVStores must be mounted and finally LoadLatestVersion or LoadVersion must be called.
func (*Store) AddListeners ¶
func (rs *Store) AddListeners(key types.StoreKey, listeners []types.WriteListener)
AddListeners adds listeners for a specific KVStore
func (*Store) CacheMultiStore ¶
func (rs *Store) CacheMultiStore() types.CacheMultiStore
CacheMultiStore creates ephemeral branch of the multi-store and returns a CacheMultiStore. It implements the MultiStore interface.
func (*Store) CacheMultiStoreWithVersion ¶
func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)
CacheMultiStoreWithVersion is analogous to CacheMultiStore except that it attempts to load stores at a given version (height). An error is returned if any store cannot be loaded. This should only be used for querying and iterating at past heights.
func (*Store) CacheWrapWithTrace ¶
CacheWrapWithTrace implements the CacheWrapper interface.
func (*Store) GetCommitKVStore ¶
func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore
GetCommitKVStore returns a mounted CommitKVStore for a given StoreKey. If the store is wrapped in an inter-block cache, it will be unwrapped before returning.
func (*Store) GetCommitStore ¶
func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore
GetCommitStore returns a mounted CommitStore for a given StoreKey. If the store is wrapped in an inter-block cache, it will be unwrapped before returning.
func (*Store) GetKVStore ¶
GetKVStore returns a mounted KVStore for a given StoreKey. If tracing is enabled on the KVStore, a wrapped TraceKVStore will be returned with the root store's tracer, otherwise, the original KVStore will be returned.
NOTE: The returned KVStore may be wrapped in an inter-block cache if it is set on the root store.
func (*Store) GetPruning ¶
func (rs *Store) GetPruning() pruningtypes.PruningOptions
GetPruning fetches the pruning strategy from the root store.
func (*Store) GetStore ¶
GetStore returns a mounted Store for a given StoreKey. If the StoreKey does not exist, it will panic. If the Store is wrapped in an inter-block cache, it will be unwrapped prior to being returned.
TODO: This isn't used directly upstream. Consider returning the Store as-is instead of unwrapping.
func (*Store) GetStoreByName ¶
getStoreByName performs a lookup of a StoreKey given a store name typically provided in a path. The StoreKey is then used to perform a lookup and return a Store. If the Store is wrapped in an inter-block cache, it will be unwrapped prior to being returned. If the StoreKey does not exist, nil is returned.
func (*Store) GetStoreType ¶
GetStoreType implements Store.
func (*Store) LastCommitID ¶
LastCommitID implements Committer/CommitStore.
func (*Store) LatestVersion ¶
LatestVersion returns the latest version in the store
func (*Store) ListeningEnabled ¶
ListeningEnabled returns if listening is enabled for a specific KVStore
func (*Store) LoadLatestVersion ¶
LoadLatestVersion implements CommitMultiStore.
func (*Store) LoadLatestVersionAndUpgrade ¶
func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) error
LoadLatestVersionAndUpgrade implements CommitMultiStore
func (*Store) LoadVersion ¶
LoadVersion implements CommitMultiStore.
func (*Store) LoadVersionAndUpgrade ¶
func (rs *Store) LoadVersionAndUpgrade(ver int64, upgrades *types.StoreUpgrades) error
LoadVersionAndUpgrade allows us to rename substores while loading an older version
func (*Store) MountStoreWithDB ¶
MountStoreWithDB implements CommitMultiStore.
func (*Store) PruneSnapshotHeight ¶
PruneSnapshotHeight prunes the given height according to the prune strategy. If PruneNothing, this is a no-op. If other strategy, this height is persisted until it is less than <current height> - KeepRecent and <current height> % Interval == 0
func (*Store) PruneStores ¶
PruneStores prunes the specific heights of the multi store. If clearPruningManager is true, the pruning manager will return the pruning heights, and they are appended to the pruningHeights to be pruned.
func (*Store) Query ¶
func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery
Query calls substore.Query with the same `req` where `req.Path` is modified to remove the substore prefix. Ie. `req.Path` here is `/<substore>/<path>`, and trimmed to `/<path>` for the substore. TODO: add proof for `multistore -> substore`.
func (*Store) Restore ¶
func (rs *Store) Restore( height uint64, format uint32, protoReader protoio.Reader, ) (snapshottypes.SnapshotItem, error)
Restore implements snapshottypes.Snapshotter. returns next snapshot item and error.
func (*Store) RollbackToVersion ¶
RollbackToVersion delete the versions after `target` and update the latest version.
func (*Store) SetIAVLCacheSize ¶
func (*Store) SetIAVLDisableFastNode ¶
func (*Store) SetInitialVersion ¶
SetInitialVersion sets the initial version of the IAVL tree. It is used when starting a new chain at an arbitrary height.
func (*Store) SetInterBlockCache ¶
func (rs *Store) SetInterBlockCache(c types.MultiStorePersistentCache)
SetInterBlockCache sets the Store's internal inter-block (persistent) cache. When this is defined, all CommitKVStores will be wrapped with their respective inter-block cache.
func (*Store) SetLazyLoading ¶
SetLazyLoading sets if the iavl store should be loaded lazily or not
func (*Store) SetMetrics ¶
func (rs *Store) SetMetrics(metrics metrics.StoreMetrics)
SetMetrics sets the metrics gatherer for the store package
func (*Store) SetPruning ¶
func (rs *Store) SetPruning(pruningOpts pruningtypes.PruningOptions)
SetPruning sets the pruning strategy on the root store and all the sub-stores. Note, calling SetPruning on the root store prior to LoadVersion or LoadLatestVersion performs a no-op as the stores aren't mounted yet.
func (*Store) SetSnapshotInterval ¶
SetSnapshotInterval sets the interval at which the snapshots are taken. It is used by the store to determine which heights to retain until after the snapshot is complete.
func (*Store) SetTracer ¶
func (rs *Store) SetTracer(w io.Writer) types.MultiStore
SetTracer sets the tracer for the MultiStore that the underlying stores will utilize to trace operations. A MultiStore is returned.
func (*Store) SetTracingContext ¶
func (rs *Store) SetTracingContext(tc types.TraceContext) types.MultiStore
SetTracingContext updates the tracing context for the MultiStore by merging the given context with the existing context by key. Any existing keys will be overwritten. It is implied that the caller should update the context when necessary between tracing operations. It returns a modified MultiStore.
func (*Store) Snapshot ¶
Snapshot implements snapshottypes.Snapshotter. The snapshot output for a given format must be identical across nodes such that chunks from different sources fit together. If the output for a given format changes (at the byte level), the snapshot format must be bumped - see TestMultistoreSnapshot_Checksum test.
func (*Store) StoreKeysByName ¶
StoreKeysByName returns mapping storeNames -> StoreKeys
func (*Store) TracingEnabled ¶
TracingEnabled returns if tracing is enabled for the MultiStore.