Documentation
¶
Overview ¶
Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
- type BranchNode
- func (*BranchNode) Descriptor() ([]byte, []int)
- func (m *BranchNode) GetChildren() [][]byte
- func (m *BranchNode) GetDeleted() bool
- func (m *BranchNode) GetValuePtr() []byte
- func (*BranchNode) ProtoMessage()
- func (m *BranchNode) Reset()
- func (m *BranchNode) String() string
- func (m *BranchNode) XXX_DiscardUnknown()
- func (m *BranchNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BranchNode) XXX_Merge(src proto.Message)
- func (m *BranchNode) XXX_Size() int
- func (m *BranchNode) XXX_Unmarshal(b []byte) error
- type EmptyNode
- func (*EmptyNode) Descriptor() ([]byte, []int)
- func (*EmptyNode) ProtoMessage()
- func (m *EmptyNode) Reset()
- func (m *EmptyNode) String() string
- func (m *EmptyNode) XXX_DiscardUnknown()
- func (m *EmptyNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EmptyNode) XXX_Merge(src proto.Message)
- func (m *EmptyNode) XXX_Size() int
- func (m *EmptyNode) XXX_Unmarshal(b []byte) error
- type ExtensionNode
- func (*ExtensionNode) Descriptor() ([]byte, []int)
- func (m *ExtensionNode) GetChild() []byte
- func (m *ExtensionNode) GetKey() []byte
- func (*ExtensionNode) ProtoMessage()
- func (m *ExtensionNode) Reset()
- func (m *ExtensionNode) String() string
- func (m *ExtensionNode) XXX_DiscardUnknown()
- func (m *ExtensionNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExtensionNode) XXX_Merge(src proto.Message)
- func (m *ExtensionNode) XXX_Size() int
- func (m *ExtensionNode) XXX_Unmarshal(b []byte) error
- type MPTrie
- func (t *MPTrie) Commit(blockNum uint64) error
- func (t *MPTrie) Delete(key []byte) ([]byte, error)
- func (t *MPTrie) Get(key []byte) ([]byte, error)
- func (t *MPTrie) GetProof(key []byte, isDeleted bool) (*state.Proof, error)
- func (t *MPTrie) Hash() ([]byte, error)
- func (t *MPTrie) Update(key, value []byte) error
- type Store
- type TrieNode
- type TrieNodeWithValue
- type ValueNode
- func (*ValueNode) Descriptor() ([]byte, []int)
- func (m *ValueNode) GetDeleted() bool
- func (m *ValueNode) GetKey() []byte
- func (m *ValueNode) GetValuePtr() []byte
- func (*ValueNode) ProtoMessage()
- func (m *ValueNode) Reset()
- func (m *ValueNode) String() string
- func (m *ValueNode) XXX_DiscardUnknown()
- func (m *ValueNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValueNode) XXX_Merge(src proto.Message)
- func (m *ValueNode) XXX_Size() int
- func (m *ValueNode) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BranchNode ¶
type BranchNode struct {
Children [][]byte `protobuf:"bytes,1,rep,name=children,proto3" json:"children,omitempty"`
ValuePtr []byte `protobuf:"bytes,2,opt,name=valuePtr,proto3" json:"valuePtr,omitempty"`
Deleted bool `protobuf:"varint,3,opt,name=deleted,proto3" json:"deleted,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*BranchNode) Descriptor ¶
func (*BranchNode) Descriptor() ([]byte, []int)
func (*BranchNode) GetChildren ¶
func (m *BranchNode) GetChildren() [][]byte
func (*BranchNode) GetDeleted ¶
func (m *BranchNode) GetDeleted() bool
func (*BranchNode) GetValuePtr ¶
func (m *BranchNode) GetValuePtr() []byte
func (*BranchNode) ProtoMessage ¶
func (*BranchNode) ProtoMessage()
func (*BranchNode) Reset ¶
func (m *BranchNode) Reset()
func (*BranchNode) String ¶
func (m *BranchNode) String() string
func (*BranchNode) XXX_DiscardUnknown ¶
func (m *BranchNode) XXX_DiscardUnknown()
func (*BranchNode) XXX_Marshal ¶
func (m *BranchNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BranchNode) XXX_Merge ¶
func (m *BranchNode) XXX_Merge(src proto.Message)
func (*BranchNode) XXX_Size ¶
func (m *BranchNode) XXX_Size() int
func (*BranchNode) XXX_Unmarshal ¶
func (m *BranchNode) XXX_Unmarshal(b []byte) error
type EmptyNode ¶
type EmptyNode struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*EmptyNode) Descriptor ¶
func (*EmptyNode) ProtoMessage ¶
func (*EmptyNode) ProtoMessage()
func (*EmptyNode) XXX_DiscardUnknown ¶
func (m *EmptyNode) XXX_DiscardUnknown()
func (*EmptyNode) XXX_Marshal ¶
func (*EmptyNode) XXX_Unmarshal ¶
type ExtensionNode ¶
type ExtensionNode struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Child []byte `protobuf:"bytes,2,opt,name=child,proto3" json:"child,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*ExtensionNode) Descriptor ¶
func (*ExtensionNode) Descriptor() ([]byte, []int)
func (*ExtensionNode) GetChild ¶
func (m *ExtensionNode) GetChild() []byte
func (*ExtensionNode) GetKey ¶
func (m *ExtensionNode) GetKey() []byte
func (*ExtensionNode) ProtoMessage ¶
func (*ExtensionNode) ProtoMessage()
func (*ExtensionNode) Reset ¶
func (m *ExtensionNode) Reset()
func (*ExtensionNode) String ¶
func (m *ExtensionNode) String() string
func (*ExtensionNode) XXX_DiscardUnknown ¶
func (m *ExtensionNode) XXX_DiscardUnknown()
func (*ExtensionNode) XXX_Marshal ¶
func (m *ExtensionNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExtensionNode) XXX_Merge ¶
func (m *ExtensionNode) XXX_Merge(src proto.Message)
func (*ExtensionNode) XXX_Size ¶
func (m *ExtensionNode) XXX_Size() int
func (*ExtensionNode) XXX_Unmarshal ¶
func (m *ExtensionNode) XXX_Unmarshal(b []byte) error
type MPTrie ¶
type MPTrie struct {
// contains filtered or unexported fields
}
MPTrie is a Merkle-Patricia Trie implementation. No node/value data stored inside trie, but in associated TrieStore
func NewTrie ¶
NewTrie creates new Merkle-Patricia Trie, with backend store. If root node Hash is not nil, root node loaded from store, otherwise, empty trie is created
type Store ¶
type Store interface {
// GetNode returns TrieNode associated with key/ptr. It may be temporal node
// created by PutNode, node market to persist after PersistNode or after executing
// CommitPersistChanges actually stored in backend storage node
GetNode(nodePtr []byte) (TrieNode, error)
// GetValue return value bytes associated with value ptr. Same logic as in GetNode applies.
GetValue(valuePtr []byte) ([]byte, error)
// PutNode store node data it temporal way - it my be accessed by GetNode, but will not stored in backend store.
PutNode(nodePtr []byte, node TrieNode) error
// PutValue do the same as PutNode, but for value
PutValue(valuePtr, value []byte) error
// PersistNode mark temporal node to be persisted to backend storage in next call to CommitPersistChanges
PersistNode(nodePtr []byte) (bool, error)
// PersistValue do same as PersistNode, but for value
PersistValue(valuePtr []byte) (bool, error)
// Height returns number of last block trie was persist for
Height() (uint64, error)
// CommitChanges frees all inMemory nodes and actually stores nodes and value marked to be persist by
// PersistNode and PersistValue in single backend store update - usually used with block number
CommitChanges(blockNum uint64) error
// RollbackChanges free all in memory nodes and nodes marked to be persist, without storing anything in
// underlying database. Operation can cause to current MPTrie become invalid, so always reload trie
// after the call
RollbackChanges() error
// IsDisabled is true when the MP-Trie is disabled.
IsDisabled() bool
// SetDisabled disabled the MPTrie
SetDisabled(disabled bool)
}
Store stores Trie nodes and values in way Hash(node)->node bytes Hash(value)->value bytes
type TrieNodeWithValue ¶
type TrieNodeWithValue interface {
TrieNode
// contains filtered or unexported methods
}
type ValueNode ¶
type ValueNode struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
ValuePtr []byte `protobuf:"bytes,2,opt,name=valuePtr,proto3" json:"valuePtr,omitempty"`
Deleted bool `protobuf:"varint,3,opt,name=deleted,proto3" json:"deleted,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*ValueNode) Descriptor ¶
func (*ValueNode) GetDeleted ¶
func (*ValueNode) GetValuePtr ¶
func (*ValueNode) ProtoMessage ¶
func (*ValueNode) ProtoMessage()
func (*ValueNode) XXX_DiscardUnknown ¶
func (m *ValueNode) XXX_DiscardUnknown()
func (*ValueNode) XXX_Marshal ¶
func (*ValueNode) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.