Documentation ¶
Index ¶
- Constants
- func CopyBytes(b []byte) (copiedBytes []byte)
- func Deserialize(hash []byte, r io.Reader, needFlags bool) (node, error)
- func Sha256Key(bs []byte) []byte
- type Database
- type Iterator
- type MemDatabase
- type NodeIterator
- type RefCounts
- func (ref *RefCounts) ClearNeedReset() error
- func (ref *RefCounts) Commit() error
- func (ref *RefCounts) Compact() error
- func (ref *RefCounts) CreateRefCounts(hash common.Uint256, inMemory, persistIntermediate bool) error
- func (ref *RefCounts) LengthOfCounts() int
- func (ref *RefCounts) NeedReset() (bool, error)
- func (ref *RefCounts) NewBatch() error
- func (ref *RefCounts) PersistNeedReset() error
- func (ref *RefCounts) PersistPrunedHeights() error
- func (ref *RefCounts) PersistRefCountHeights() error
- func (ref *RefCounts) PersistRefCounts() error
- func (ref *RefCounts) Prune(hash common.Uint256, inMemory bool) error
- func (ref *RefCounts) RebuildRefCount() error
- func (ref *RefCounts) RemoveAllRefCount() error
- func (ref *RefCounts) SequentialPrune() error
- func (ref *RefCounts) Verify(hash common.Uint256) error
- type Sync
- type SyncPath
- type SyncResult
- type Trie
- func (t *Trie) Commit() (common.Uint256, error)
- func (t *Trie) CommitTo(db Database) (common.Uint256, error)
- func (t *Trie) Copy() *Trie
- func (t *Trie) Delete(key []byte)
- func (t *Trie) Get(key []byte) []byte
- func (t *Trie) Hash() common.Uint256
- func (t *Trie) NewRefCounts(targetRefCountHeight, targetPruningHeight uint32) (*RefCounts, error)
- func (t *Trie) NodeIterator(start []byte) NodeIterator
- func (t *Trie) Reset()
- func (t *Trie) TryDelete(key []byte) error
- func (t *Trie) TryGet(key []byte) ([]byte, error)
- func (t *Trie) TryTraverse(needPrint bool) error
- func (t *Trie) TryUpdate(key, value []byte) error
- func (t *Trie) Update(key, value []byte)
Constants ¶
const ( TagHashNode = 0 TagValueNode = 1 TagShortNode = 2 TagFullNode = 17 LenOfChildrenNodes = 17 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Iterator ¶
type Iterator struct { Key []byte Value []byte Err error // contains filtered or unexported fields }
func NewIterator ¶
func NewIterator(it NodeIterator) *Iterator
type MemDatabase ¶
type MemDatabase struct {
// contains filtered or unexported fields
}
func NewMemDatabase ¶
func NewMemDatabase() *MemDatabase
func (*MemDatabase) Delete ¶
func (db *MemDatabase) Delete(key []byte) error
func (*MemDatabase) ViewDB ¶
func (db *MemDatabase) ViewDB()
type NodeIterator ¶
type RefCounts ¶
type RefCounts struct {
// contains filtered or unexported fields
}
func NewRefCounts ¶
func (*RefCounts) ClearNeedReset ¶ added in v2.1.7
func (*RefCounts) CreateRefCounts ¶
func (*RefCounts) LengthOfCounts ¶
func (*RefCounts) PersistNeedReset ¶ added in v2.1.7
func (*RefCounts) PersistPrunedHeights ¶
func (*RefCounts) PersistRefCountHeights ¶
func (*RefCounts) PersistRefCounts ¶
func (*RefCounts) RebuildRefCount ¶
func (*RefCounts) RemoveAllRefCount ¶ added in v2.1.7
func (*RefCounts) SequentialPrune ¶
type Sync ¶ added in v2.1.7
type Sync struct { sync.RWMutex DataAvailable chan struct{} // Notify when new states arrived // contains filtered or unexported fields }
Sync is the main state trie synchronisation scheduler, which provides yet unknown trie hashes to retrieve, accepts node data associated with said hashes and reconstructs the trie step by step until all is done.
func (*Sync) AddSubTrie ¶ added in v2.1.7
AddSubTrie registers a new trie to the sync code, rooted at the designated parent.
func (*Sync) Commit ¶ added in v2.1.7
Commit flushes the data stored in the internal membatch out to persistent storage, returning any occurred error.
func (*Sync) Pending ¶ added in v2.1.7
Pending returns the number of state entries currently pending for download.
func (*Sync) Process ¶ added in v2.1.7
func (s *Sync) Process(result SyncResult) error
Process injects the received data for requested item.
type SyncResult ¶ added in v2.1.7
type SyncResult struct { Hash common.Uint256 // Hash of the originally unknown trie node Data []byte // Data content of the retrieved node }
SyncResult is a response with requested data along with it's hash.
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
func (*Trie) NewRefCounts ¶
func (*Trie) NodeIterator ¶
func (t *Trie) NodeIterator(start []byte) NodeIterator
func (*Trie) Reset ¶ added in v2.1.6
func (t *Trie) Reset()
Reset drops the referenced root node and cleans all internal state.