Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultProofRuntime() (prt *merkle.ProofRuntime)
- func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
- func RequireProof(subpath string) bool
- type CommitID
- func (*CommitID) Descriptor() ([]byte, []int)
- func (m *CommitID) GetHash() []byte
- func (m *CommitID) GetVersion() int64
- func (m *CommitID) Marshal() (dAtA []byte, err error)
- func (m *CommitID) MarshalTo(dAtA []byte) (int, error)
- func (m *CommitID) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CommitID) ProtoMessage()
- func (m *CommitID) Reset()
- func (m *CommitID) Size() (n int)
- func (m *CommitID) String() string
- func (m *CommitID) Unmarshal(dAtA []byte) error
- func (m *CommitID) XXX_DiscardUnknown()
- func (m *CommitID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CommitID) XXX_Merge(src proto.Message)
- func (m *CommitID) XXX_Size() int
- func (m *CommitID) XXX_Unmarshal(b []byte) error
- type CommitInfo
- func (ci *CommitInfo) CommitID() types.CommitID
- func (*CommitInfo) Descriptor() ([]byte, []int)
- func (m *CommitInfo) GetStoreInfos() []StoreInfo
- func (m *CommitInfo) GetVersion() int64
- func (ci *CommitInfo) Hash() []byte
- func (m *CommitInfo) Marshal() (dAtA []byte, err error)
- func (m *CommitInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *CommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CommitInfo) ProtoMessage()
- func (m *CommitInfo) Reset()
- func (m *CommitInfo) Size() (n int)
- func (m *CommitInfo) String() string
- func (m *CommitInfo) Unmarshal(dAtA []byte) error
- func (m *CommitInfo) XXX_DiscardUnknown()
- func (m *CommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CommitInfo) XXX_Merge(src proto.Message)
- func (m *CommitInfo) XXX_Size() int
- func (m *CommitInfo) XXX_Unmarshal(b []byte) error
- type MultiStoreProof
- func (proof *MultiStoreProof) ComputeRootHash() []byte
- func (*MultiStoreProof) Descriptor() ([]byte, []int)
- func (m *MultiStoreProof) GetStoreInfos() []StoreInfo
- func (m *MultiStoreProof) Marshal() (dAtA []byte, err error)
- func (m *MultiStoreProof) MarshalTo(dAtA []byte) (int, error)
- func (m *MultiStoreProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MultiStoreProof) ProtoMessage()
- func (m *MultiStoreProof) Reset()
- func (m *MultiStoreProof) Size() (n int)
- func (m *MultiStoreProof) String() string
- func (m *MultiStoreProof) Unmarshal(dAtA []byte) error
- func (m *MultiStoreProof) XXX_DiscardUnknown()
- func (m *MultiStoreProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MultiStoreProof) XXX_Merge(src proto.Message)
- func (m *MultiStoreProof) XXX_Size() int
- func (m *MultiStoreProof) XXX_Unmarshal(b []byte) error
- type MultiStoreProofOp
- func (*MultiStoreProofOp) Descriptor() ([]byte, []int)
- func (m *MultiStoreProofOp) GetKey() []byte
- func (m *MultiStoreProofOp) GetProof() *MultiStoreProof
- func (m *MultiStoreProofOp) Marshal() (dAtA []byte, err error)
- func (m *MultiStoreProofOp) MarshalTo(dAtA []byte) (int, error)
- func (m *MultiStoreProofOp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (op *MultiStoreProofOp) ProofOp() merkle.ProofOp
- func (*MultiStoreProofOp) ProtoMessage()
- func (m *MultiStoreProofOp) Reset()
- func (op MultiStoreProofOp) Run(args [][]byte) ([][]byte, error)
- func (m *MultiStoreProofOp) Size() (n int)
- func (m *MultiStoreProofOp) String() string
- func (m *MultiStoreProofOp) Unmarshal(dAtA []byte) error
- func (m *MultiStoreProofOp) XXX_DiscardUnknown()
- func (m *MultiStoreProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MultiStoreProofOp) XXX_Merge(src proto.Message)
- func (m *MultiStoreProofOp) XXX_Size() int
- func (m *MultiStoreProofOp) XXX_Unmarshal(b []byte) error
- type Store
- 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) CopyStore() *types.Store
- 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) GetStore(key types.StoreKey) types.Store
- func (rs *Store) GetStoreType() types.StoreType
- func (rs *Store) LastCommitID() types.CommitID
- func (rs *Store) LoadLatestVersion() error
- func (rs *Store) LoadLazyVersion(ver int64) (*types.Store, error)
- func (rs *Store) LoadVersion(ver int64) error
- func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db dbm.DB)
- func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery
- func (rs *Store) RollbackVersion(height int64) error
- func (rs *Store) SetLazyLoading(lazyLoading bool)
- func (rs *Store) SetPruning(pruningOpts types.PruningOptions)
- func (rs *Store) SetTracer(w io.Writer) types.MultiStore
- func (rs *Store) SetTracingContext(tc types.TraceContext) types.MultiStore
- func (rs *Store) TracingEnabled() bool
- type StoreCore
- func (*StoreCore) Descriptor() ([]byte, []int)
- func (m *StoreCore) GetCommitID() github_com_pokt_network_pocket_core_store_types.CommitID
- func (m *StoreCore) Marshal() (dAtA []byte, err error)
- func (m *StoreCore) MarshalTo(dAtA []byte) (int, error)
- func (m *StoreCore) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*StoreCore) ProtoMessage()
- func (m *StoreCore) Reset()
- func (m *StoreCore) Size() (n int)
- func (m *StoreCore) String() string
- func (m *StoreCore) Unmarshal(dAtA []byte) error
- func (m *StoreCore) XXX_DiscardUnknown()
- func (m *StoreCore) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StoreCore) XXX_Merge(src proto.Message)
- func (m *StoreCore) XXX_Size() int
- func (m *StoreCore) XXX_Unmarshal(b []byte) error
- type StoreInfo
- func (*StoreInfo) Descriptor() ([]byte, []int)
- func (m *StoreInfo) GetCore() StoreCore
- func (m *StoreInfo) GetName() string
- func (si StoreInfo) Hash() []byte
- func (m *StoreInfo) Marshal() (dAtA []byte, err error)
- func (m *StoreInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *StoreInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*StoreInfo) ProtoMessage()
- func (m *StoreInfo) Reset()
- func (m *StoreInfo) Size() (n int)
- func (m *StoreInfo) String() string
- func (m *StoreInfo) Unmarshal(dAtA []byte) error
- func (m *StoreInfo) XXX_DiscardUnknown()
- func (m *StoreInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *StoreInfo) XXX_Merge(src proto.Message)
- func (m *StoreInfo) XXX_Size() int
- func (m *StoreInfo) XXX_Unmarshal(b []byte) error
Constants ¶
const MemoryCacheCapacity = 12
const ProofOpMultiStore = "multistore"
the multi-store proof operation constant value
Variables ¶
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 MultiStoreProofOpDecoder ¶
func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
MultiStoreProofOpDecoder returns a multi-store merkle proof operator from a given proof operation.
func RequireProof ¶
RequireProof returns whether proof is required for the subpath.
Types ¶
type CommitID ¶
type CommitID struct { Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` }
func (*CommitID) Descriptor ¶
func (*CommitID) GetVersion ¶
func (*CommitID) MarshalToSizedBuffer ¶
func (*CommitID) ProtoMessage ¶
func (*CommitID) ProtoMessage()
func (*CommitID) XXX_DiscardUnknown ¶
func (m *CommitID) XXX_DiscardUnknown()
func (*CommitID) XXX_Marshal ¶
func (*CommitID) XXX_Unmarshal ¶
type CommitInfo ¶
type CommitInfo struct { Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` StoreInfos []StoreInfo `protobuf:"bytes,2,rep,name=store_infos,json=storeInfos,proto3" json:"store_infos"` }
CommitInfo defines commit information used by the multi-store when committing a version/height.
func (*CommitInfo) CommitID ¶
func (ci *CommitInfo) CommitID() types.CommitID
func (*CommitInfo) Descriptor ¶
func (*CommitInfo) Descriptor() ([]byte, []int)
func (*CommitInfo) GetStoreInfos ¶
func (m *CommitInfo) GetStoreInfos() []StoreInfo
func (*CommitInfo) GetVersion ¶
func (m *CommitInfo) GetVersion() int64
func (*CommitInfo) Hash ¶
func (ci *CommitInfo) Hash() []byte
Hash returns the simple merkle root hash of the stores sorted by name.
func (*CommitInfo) Marshal ¶
func (m *CommitInfo) Marshal() (dAtA []byte, err error)
func (*CommitInfo) MarshalToSizedBuffer ¶
func (m *CommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CommitInfo) ProtoMessage ¶
func (*CommitInfo) ProtoMessage()
func (*CommitInfo) Reset ¶
func (m *CommitInfo) Reset()
func (*CommitInfo) Size ¶
func (m *CommitInfo) Size() (n int)
func (*CommitInfo) String ¶
func (m *CommitInfo) String() string
func (*CommitInfo) Unmarshal ¶
func (m *CommitInfo) Unmarshal(dAtA []byte) error
func (*CommitInfo) XXX_DiscardUnknown ¶
func (m *CommitInfo) XXX_DiscardUnknown()
func (*CommitInfo) XXX_Marshal ¶
func (m *CommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CommitInfo) XXX_Merge ¶
func (m *CommitInfo) XXX_Merge(src proto.Message)
func (*CommitInfo) XXX_Size ¶
func (m *CommitInfo) XXX_Size() int
func (*CommitInfo) XXX_Unmarshal ¶
func (m *CommitInfo) XXX_Unmarshal(b []byte) error
type MultiStoreProof ¶
type MultiStoreProof struct {
StoreInfos []StoreInfo `protobuf:"bytes,1,rep,name=storeInfos,proto3" json:"storeInfos"`
}
func NewMultiStoreProof ¶
func NewMultiStoreProof(storeInfos []StoreInfo) *MultiStoreProof
MultiStoreProof defines a collection of store proofs in a multi-store
type MultiStoreProof struct { StoreInfos []StoreInfo }
func (*MultiStoreProof) ComputeRootHash ¶
func (proof *MultiStoreProof) ComputeRootHash() []byte
ComputeRootHash returns the root hash for a given multi-store proof.
func (*MultiStoreProof) Descriptor ¶
func (*MultiStoreProof) Descriptor() ([]byte, []int)
func (*MultiStoreProof) GetStoreInfos ¶
func (m *MultiStoreProof) GetStoreInfos() []StoreInfo
func (*MultiStoreProof) Marshal ¶
func (m *MultiStoreProof) Marshal() (dAtA []byte, err error)
func (*MultiStoreProof) MarshalToSizedBuffer ¶
func (m *MultiStoreProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MultiStoreProof) ProtoMessage ¶
func (*MultiStoreProof) ProtoMessage()
func (*MultiStoreProof) Reset ¶
func (m *MultiStoreProof) Reset()
func (*MultiStoreProof) Size ¶
func (m *MultiStoreProof) Size() (n int)
func (*MultiStoreProof) String ¶
func (m *MultiStoreProof) String() string
func (*MultiStoreProof) Unmarshal ¶
func (m *MultiStoreProof) Unmarshal(dAtA []byte) error
func (*MultiStoreProof) XXX_DiscardUnknown ¶
func (m *MultiStoreProof) XXX_DiscardUnknown()
func (*MultiStoreProof) XXX_Marshal ¶
func (m *MultiStoreProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MultiStoreProof) XXX_Merge ¶
func (m *MultiStoreProof) XXX_Merge(src proto.Message)
func (*MultiStoreProof) XXX_Size ¶
func (m *MultiStoreProof) XXX_Size() int
func (*MultiStoreProof) XXX_Unmarshal ¶
func (m *MultiStoreProof) XXX_Unmarshal(b []byte) error
type MultiStoreProofOp ¶
type MultiStoreProofOp struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Proof *MultiStoreProof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof"` }
func NewMultiStoreProofOp ¶
func NewMultiStoreProofOp(key []byte, proof *MultiStoreProof) *MultiStoreProofOp
func (*MultiStoreProofOp) Descriptor ¶
func (*MultiStoreProofOp) Descriptor() ([]byte, []int)
func (*MultiStoreProofOp) GetKey ¶
func (m *MultiStoreProofOp) GetKey() []byte
func (*MultiStoreProofOp) GetProof ¶
func (m *MultiStoreProofOp) GetProof() *MultiStoreProof
func (*MultiStoreProofOp) Marshal ¶
func (m *MultiStoreProofOp) Marshal() (dAtA []byte, err error)
func (*MultiStoreProofOp) MarshalTo ¶
func (m *MultiStoreProofOp) MarshalTo(dAtA []byte) (int, error)
func (*MultiStoreProofOp) MarshalToSizedBuffer ¶
func (m *MultiStoreProofOp) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MultiStoreProofOp) ProofOp ¶
func (op *MultiStoreProofOp) ProofOp() merkle.ProofOp
ProofOp return a merkle proof operation from a given multi-store proof operation.
func (*MultiStoreProofOp) ProtoMessage ¶
func (*MultiStoreProofOp) ProtoMessage()
func (*MultiStoreProofOp) Reset ¶
func (m *MultiStoreProofOp) Reset()
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) Size ¶
func (m *MultiStoreProofOp) Size() (n int)
func (*MultiStoreProofOp) String ¶
func (m *MultiStoreProofOp) String() string
func (*MultiStoreProofOp) Unmarshal ¶
func (m *MultiStoreProofOp) Unmarshal(dAtA []byte) error
func (*MultiStoreProofOp) XXX_DiscardUnknown ¶
func (m *MultiStoreProofOp) XXX_DiscardUnknown()
func (*MultiStoreProofOp) XXX_Marshal ¶
func (m *MultiStoreProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MultiStoreProofOp) XXX_Merge ¶
func (m *MultiStoreProofOp) XXX_Merge(src proto.Message)
func (*MultiStoreProofOp) XXX_Size ¶
func (m *MultiStoreProofOp) XXX_Size() int
func (*MultiStoreProofOp) XXX_Unmarshal ¶
func (m *MultiStoreProofOp) XXX_Unmarshal(b []byte) error
type Store ¶
type Store struct { DB dbm.DB Cache types.MultiStoreCache // contains filtered or unexported fields }
Store is composed of many CommitStores. Name contrasts with cacheMultiStore which is for cache-wrapping other MultiStores. It implements the CommitMultiStore interface.
func (*Store) CacheMultiStore ¶
func (rs *Store) CacheMultiStore() types.CacheMultiStore
Implements MultiStore.
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
Implements CommitMultiStore.
func (*Store) GetCommitStore ¶
func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore
Implements CommitMultiStore.
func (*Store) GetKVStore ¶
GetKVStore implements the MultiStore interface. If tracing is enabled on the Store, a wrapped TraceKVStore will be returned with the given tracer, otherwise, the original KVStore will be returned. If the store does not exist, panics.
func (*Store) LastCommitID ¶
Implements Committer/CommitStore.
func (*Store) LoadLatestVersion ¶
Implements CommitMultiStore.
func (*Store) LoadVersion ¶
Implements CommitMultiStore.
func (*Store) MountStoreWithDB ¶
Implements CommitMultiStore.
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) RollbackVersion ¶
Implements CommitMultiStore.
func (*Store) SetLazyLoading ¶
SetLazyLoading sets if the iavl store should be loaded lazily or not
func (*Store) SetPruning ¶
func (rs *Store) SetPruning(pruningOpts types.PruningOptions)
Implements CommitMultiStore
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) TracingEnabled ¶
TracingEnabled returns if tracing is enabled for the MultiStore.
type StoreCore ¶
type StoreCore struct {
CommitID github_com_pokt_network_pocket_core_store_types.CommitID `protobuf:"bytes,2,opt,name=commitID,proto3,casttype=github.com/pokt-network/pocket-core/store/types.CommitID" json:"commitID"`
}
func (*StoreCore) Descriptor ¶
func (*StoreCore) GetCommitID ¶
func (m *StoreCore) GetCommitID() github_com_pokt_network_pocket_core_store_types.CommitID
func (*StoreCore) MarshalToSizedBuffer ¶
func (*StoreCore) ProtoMessage ¶
func (*StoreCore) ProtoMessage()
func (*StoreCore) XXX_DiscardUnknown ¶
func (m *StoreCore) XXX_DiscardUnknown()
func (*StoreCore) XXX_Marshal ¶
func (*StoreCore) XXX_Unmarshal ¶
type StoreInfo ¶
type StoreInfo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Core StoreCore `protobuf:"bytes,2,opt,name=core,proto3" json:"core"` }
StoreInfo defines store-specific commit information. It contains a reference between a store name and the commit ID.
func (*StoreInfo) Descriptor ¶
func (*StoreInfo) MarshalToSizedBuffer ¶
func (*StoreInfo) ProtoMessage ¶
func (*StoreInfo) ProtoMessage()
func (*StoreInfo) XXX_DiscardUnknown ¶
func (m *StoreInfo) XXX_DiscardUnknown()