Versions in this module Expand all Collapse all v0 v0.0.1 Nov 26, 2021 Changes in this version + const ANSIBright + const ANSIFgBlue + const ANSIFgCyan + const ANSIFgGreen + const ANSIReset + const ProofOpIAVLAbsence + const ProofOpIAVLValue + var Branch = "" + var Commit = "" + var ErrInvalidInputs = fmt.Errorf("invalid inputs") + var ErrInvalidProof = fmt.Errorf("invalid proof") + var ErrInvalidRoot = fmt.Errorf("invalid root") + var ErrNoImport = errors.New("no import in progress") + var ErrVersionDoesNotExist = errors.New("version does not exist") + var ExportDone = errors.New("export is complete") + var Version = "" + func AbsenceOpDecoder(pop tmmerkle.ProofOp) (merkle.ProofOperator, error) + func Blue(args ...interface{}) string + func ColoredBytes(data []byte, textColor, bytesColor func(...interface{}) string) string + func Cyan(args ...interface{}) string + func Green(args ...interface{}) string + func PrintTree(tree *ImmutableTree) + func Repair013Orphans(db dbm.DB) (uint64, error) + func ValueOpDecoder(pop tmmerkle.ProofOp) (merkle.ProofOperator, error) + func WriteDOTGraph(w io.Writer, tree *ImmutableTree, paths []PathToLeaf) + type AbsenceOp struct + Proof *RangeProof + func NewAbsenceOp(key []byte, proof *RangeProof) AbsenceOp + func (op AbsenceOp) GetKey() []byte + func (op AbsenceOp) ProofOp() tmmerkle.ProofOp + func (op AbsenceOp) Run(args [][]byte) ([][]byte, error) + func (op AbsenceOp) String() string + type ExportNode struct + Height int8 + Key []byte + Value []byte + Version int64 + type Exporter struct + func (e *Exporter) Close() + func (e *Exporter) Next() (*ExportNode, error) + type ImmutableTree struct + func NewImmutableTree(db dbm.DB, cacheSize int) *ImmutableTree + func NewImmutableTreeWithOpts(db dbm.DB, cacheSize int, opts *Options) *ImmutableTree + func (t *ImmutableTree) Export() *Exporter + func (t *ImmutableTree) Get(key []byte) (index int64, value []byte) + func (t *ImmutableTree) GetByIndex(index int64) (key []byte, value []byte) + func (t *ImmutableTree) GetMembershipProof(key []byte) (*ics23.CommitmentProof, error) + func (t *ImmutableTree) GetNonMembershipProof(key []byte) (*ics23.CommitmentProof, error) + func (t *ImmutableTree) GetRangeWithProof(startKey []byte, endKey []byte, limit int) (keys, values [][]byte, proof *RangeProof, err error) + func (t *ImmutableTree) GetWithProof(key []byte) (value []byte, proof *RangeProof, err error) + func (t *ImmutableTree) Has(key []byte) bool + func (t *ImmutableTree) Hash() []byte + func (t *ImmutableTree) Height() int8 + func (t *ImmutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool) + func (t *ImmutableTree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool) + func (t *ImmutableTree) IterateRangeInclusive(start, end []byte, ascending bool, ...) (stopped bool) + func (t *ImmutableTree) RenderShape(indent string, encoder NodeEncoder) []string + func (t *ImmutableTree) Size() int64 + func (t *ImmutableTree) String() string + func (t *ImmutableTree) Version() int64 + type Importer struct + func (i *Importer) Add(exportNode *ExportNode) error + func (i *Importer) Close() + func (i *Importer) Commit() error + type KeyFormat struct + func NewKeyFormat(prefix byte, layout ...int) *KeyFormat + func (kf *KeyFormat) Key(args ...interface{}) []byte + func (kf *KeyFormat) KeyBytes(segments ...[]byte) []byte + func (kf *KeyFormat) Prefix() string + func (kf *KeyFormat) Scan(key []byte, args ...interface{}) + func (kf *KeyFormat) ScanBytes(key []byte) [][]byte + type MutableTree struct + func NewMutableTree(db dbm.DB, cacheSize int) (*MutableTree, error) + func NewMutableTreeWithOpts(db dbm.DB, cacheSize int, opts *Options) (*MutableTree, error) + func (tree *MutableTree) AvailableVersions() []int + func (tree *MutableTree) DeleteVersion(version int64) error + func (tree *MutableTree) DeleteVersions(versions ...int64) error + func (tree *MutableTree) DeleteVersionsRange(fromVersion, toVersion int64) error + func (tree *MutableTree) GetImmutable(version int64) (*ImmutableTree, error) + func (tree *MutableTree) GetVersioned(key []byte, version int64) (index int64, value []byte) + func (tree *MutableTree) GetVersionedRangeWithProof(startKey, endKey []byte, limit int, version int64) (keys, values [][]byte, proof *RangeProof, err error) + func (tree *MutableTree) GetVersionedWithProof(key []byte, version int64) ([]byte, *RangeProof, error) + func (tree *MutableTree) Hash() []byte + func (tree *MutableTree) Import(version int64) (*Importer, error) + func (tree *MutableTree) IsEmpty() bool + func (tree *MutableTree) LazyLoadVersion(targetVersion int64) (int64, error) + func (tree *MutableTree) Load() (int64, error) + func (tree *MutableTree) LoadVersion(targetVersion int64) (int64, error) + func (tree *MutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error) + func (tree *MutableTree) Remove(key []byte) ([]byte, bool) + func (tree *MutableTree) Rollback() + func (tree *MutableTree) SaveVersion() ([]byte, int64, error) + func (tree *MutableTree) Set(key, value []byte) (updated bool) + func (tree *MutableTree) SetInitialVersion(version uint64) + func (tree *MutableTree) String() string + func (tree *MutableTree) VersionExists(version int64) bool + func (tree *MutableTree) WorkingHash() []byte + type Node struct + func MakeNode(buf []byte) (*Node, error) + func NewNode(key []byte, value []byte, version int64) *Node + func (node *Node) PathToLeaf(t *ImmutableTree, key []byte) (PathToLeaf, *Node, error) + func (node *Node) String() string + type NodeEncoder func(id []byte, depth int, isLeaf bool) string + type Options struct + InitialVersion uint64 + Sync bool + func DefaultOptions() Options + type PathToLeaf []ProofInnerNode + func (pl PathToLeaf) Index() (idx int64) + func (pl PathToLeaf) String() string + type ProofInnerNode struct + Height int8 + Left []byte + Right []byte + Size int64 + Version int64 + func (pin ProofInnerNode) Hash(childHash []byte) []byte + func (pin ProofInnerNode) String() string + type ProofLeafNode struct + Key cmn.HexBytes + ValueHash cmn.HexBytes + Version int64 + func (pln ProofLeafNode) Hash() []byte + func (pln ProofLeafNode) String() string + type RangeProof struct + InnerNodes []PathToLeaf + Leaves []ProofLeafNode + LeftPath PathToLeaf + func RangeProofFromProto(pbProof *iavlproto.RangeProof) (RangeProof, error) + func (proof *RangeProof) ComputeRootHash() []byte + func (proof *RangeProof) Keys() (keys [][]byte) + func (proof *RangeProof) LeftIndex() int64 + func (proof *RangeProof) String() string + func (proof *RangeProof) StringIndented(indent string) string + func (proof *RangeProof) ToProto() *iavlproto.RangeProof + func (proof *RangeProof) Verify(root []byte) error + func (proof *RangeProof) VerifyAbsence(key []byte) error + func (proof *RangeProof) VerifyItem(key, value []byte) error + type ValueOp struct + Proof *RangeProof + func NewValueOp(key []byte, proof *RangeProof) ValueOp + func (op ValueOp) GetKey() []byte + func (op ValueOp) ProofOp() tmmerkle.ProofOp + func (op ValueOp) Run(args [][]byte) ([][]byte, error) + func (op ValueOp) String() string + type VersionInfo struct + Branch string + GitCommit string + GoVersion string + IAVL string + func GetVersionInfo() VersionInfo + func (v VersionInfo) String() string