package
1.13.0
Repository: https://github.com/0chain/common.git
Documentation: pkg.go.dev

# Functions

CloneMPT - clone an existing MPT so it can go off of a different root.
CreateNode - create a node based on the serialization prefix */.
GetPruneStats - returns a prune stats object from the context */.
GetSerializationPrefix - get the serialization prefix */.
GetValueNode - get the value node associated with this node*/.
Hash - the hashing used for the merkle tree construction */.
HashStringToBytes - convert a hex hash string to bytes */.
IncludesNodeType - checks if the given node type is one of the node types in the mask */.
IsMPTValid - checks if the merkle tree is in valid state or not */.
MergeState - merge the state from another node db.
MHash - merkle hashing of a pair of child hashes */.
NewChangeCollector - a constructor to create a change collector */.
NewExtensionNode - create a new extension node */.
NewFullNode - create a new full node */.
NewLeafNode - create a new leaf node */.
NewLevelNodeDB - create a level node db.
NewMemoryNodeDB - create a memory node db.
NewMerklePatriciaTrie - create a new patricia merkle trie */.
NewOriginTrackerNode - create a new origin tracker node.
NewPNodeDB - create a new PNodeDB.
NewValueNode - create a new value node.
No description provided by the author
ToHex - converts a byte array to hex encoding */.
ToUpperHex - converts a byte array to hex encoding with upper case */.
VerifyMerklePath - verify the given merkle path.
WithPruneStats - return a context with a prune stats object */.

# Constants

BatchSize - for batching multiple db operations.
FmtIntermediateNodeExists - error format indicating deleted intermediate node still exists.
1 MB.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
PruneStatsKey - key used to get the prune stats object from the context */.
Separator - used to separate fields when creating data array to hash.
No description provided by the author
No description provided by the author

# Variables

DebugMPTNode - for detailed debugging.
ErrInvalidEncoding - error to indicate invalid encoding.
ErrIteratingChildNodes - indicates an error iterting the child nodes.
ErrIteratingChildNodes - indicates an error iterting the child nodes.
ErrNilPartialStateRoot is returned when partialState.ComputeRoot() gets nil root.
ErrNodeNotFound - error indicating that the node is not found.
ErrValueNotPresent - error indicating given path is not present in the db.
PathElements - all the bytes that can be used as path elements as ascii characters.
No description provided by the author

# Structs

ChangeCollector - node change collector interface implementation */.
ExtensionNode - a multi-char length path along which there are no branches, at the end of this path there should be full node */.
FullNode - a branch node that can contain 16 children and a value */.
LeafNode - a node that represents the leaf that contains a value and an optional path */.
LevelNodeDB - a multi-level node db.
MemoryNodeDB - an inmemory node db.
MerklePatriciaTrie - it's a merkle tree and a patricia trie */.
MerkleTree - A data structure that implements MerkleTreeI interface */.
MTPath - The merkle tree path*/.
NodeChange - track a change to the node */.
OriginTracker - implements the OriginTrackerI interface */.
OriginTrackerNode - a node that implements origin tracking.
PNodeDB - a node db that is persisted */.
PruneStats - gathers statistics while pruning */.
SecureSerializableValue - a proxy persisted value that just tracks the encoded bytes of a persisted value */.
ValueNode - any node that holds a value should implement this */.

# Interfaces

ChangeCollectorI - an interface to collect node changes */.
Hashable - anything that can provide it's hash */.
MerklePatriciaTrieI - interface of the merkle patricia trie.
MerkleTreeI - a merkle tree interface required for constructing and providing verification */.
go:generate mockery --inpackage --case underscore --name MPTSerializable --testonly MPTSerializable represents the interface for encoding/decoding data that stores in MPT.
MPTSerializableSize wraps the MPTSerializable and msgp.Sizer interfaces.
Node - a node interface */.
NodeDB - an interface that gets, puts and deletes nodes by their key */.
OriginTrackerI - tracks the origin * This is required to do pruning of nodes.
SecureSerializableValueI an interface that makes a serializable value secure with hashing */.
Serializable interface */.

# Type aliases

ContextKey - a type for context key.
Key - a type for the merkle patricia trie node key.
MPTIteratorHandler is a collection iteration handler function type */.
MPTMissingNodeHandler - a handler for missing keys during iteration.
NodeDBIteratorHandler is a nodedb iteration handler function type */.
Path - a type for the path of the merkle patricia trie.
Sequence - a data type that can be used to track the origin, latest version and sync version of a node.
StrKey - data type for the key used to store the node into some storage (this is needed as hashmap keys can't be []byte.