Documentation ¶
Index ¶
- Variables
- func ClosePrune()
- func DelKVPair(db dbm.DB, storeDel *types.StoreGet) ([]byte, [][]byte, error)
- func EnableMVCC(enable bool)
- func EnableMavlPrefix(enable bool)
- func EnablePrune(enable bool)
- func GetKVPair(db dbm.DB, storeGet *types.StoreGet) ([][]byte, error)
- func GetKVPairProof(db dbm.DB, roothash []byte, key []byte) ([]byte, error)
- func InnerNodeProofHash(childHash []byte, branch *types.InnerNode) []byte
- func IterateRangeByStateHash(db dbm.DB, statehash, start, end []byte, ascending bool, ...)
- func NewDelNodeValuePool(cacSize int) *delNodeValuePool
- func PrintNode(node *Node)
- func PrintTreeLeaf(db dbm.DB, roothash []byte)
- func PruningTree(db dbm.DB, curHeight int64)
- func PruningTreePrintDB(db dbm.DB, prefix []byte)
- func SetKVPair(db dbm.DB, storeSet *types.StoreSet, sync bool) ([]byte, error)
- func SetPruneHeight(height int)
- func VerifyKVPairProof(db dbm.DB, roothash []byte, keyvalue types.KeyValue, proof []byte) bool
- type MarkNode
- type Node
- type Proof
- type Tree
- func (t *Tree) ConstructProof(key []byte) (value []byte, proof *Proof)
- func (t *Tree) Copy() *Tree
- func (t *Tree) Get(key []byte) (index int32, value []byte, exists bool)
- func (t *Tree) GetByIndex(index int32) (key []byte, value []byte)
- func (t *Tree) Has(key []byte) bool
- func (t *Tree) Hash() []byte
- func (t *Tree) Height() int32
- func (t *Tree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool)
- func (t *Tree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool)
- func (t *Tree) IterateRangeInclusive(start, end []byte, ascending bool, fn func(key, value []byte) bool) (stopped bool)
- func (t *Tree) Load(hash []byte) (err error)
- func (t *Tree) Proof(key []byte) (value []byte, proofBytes []byte, exists bool)
- func (t *Tree) Remove(key []byte) (value []byte, removed bool)
- func (t *Tree) Save() []byte
- func (t *Tree) Set(key []byte, value []byte) (updated bool)
- func (t *Tree) SetBlockHeight(height int64)
- func (t *Tree) Size() int32
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNodeNotExist = errors.New("ErrNodeNotExist")
)
Functions ¶
func ClosePrune ¶
func ClosePrune()
func EnableMVCC ¶
func EnableMVCC(enable bool)
func EnableMavlPrefix ¶
func EnableMavlPrefix(enable bool)
func EnablePrune ¶
func EnablePrune(enable bool)
func InnerNodeProofHash ¶
计算inner节点的hash
func IterateRangeByStateHash ¶
func NewDelNodeValuePool ¶
func NewDelNodeValuePool(cacSize int) *delNodeValuePool
func PrintTreeLeaf ¶
func PruningTree ¶
func PruningTreePrintDB ¶
func SetPruneHeight ¶
func SetPruneHeight(height int)
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
merkle avl Node
type Proof ¶
merkle avl tree proof证明结构体
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
merkle avl tree
func (*Tree) ConstructProof ¶
Returns nil, nil if key is not in tree.
func (*Tree) GetByIndex ¶
通过index获取leaf节点信息
func (*Tree) IterateRange ¶
func (t *Tree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool)
在start和end之间的键进行迭代回调[start, end)
func (*Tree) IterateRangeInclusive ¶
func (t *Tree) IterateRangeInclusive(start, end []byte, ascending bool, fn func(key, value []byte) bool) (stopped bool)
在start和end之间的键进行迭代回调[start, end]
func (*Tree) SetBlockHeight ¶
Click to show internal directories.
Click to hide internal directories.