trie

package
v0.0.0-...-f2e3eef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RangeScanIterator

type RangeScanIterator struct {
	// contains filtered or unexported fields
}

RangeScanIterator implements the interface 'statemgmt.RangeScanIterator'

func (*RangeScanIterator) Close

func (itr *RangeScanIterator) Close()

Close - see interface 'statemgmt.RangeScanIterator' for details

func (*RangeScanIterator) GetKeyValue

func (itr *RangeScanIterator) GetKeyValue() (string, []byte)

GetKeyValue - see interface 'statemgmt.RangeScanIterator' for details

func (*RangeScanIterator) Next

func (itr *RangeScanIterator) Next() bool

Next - see interface 'statemgmt.RangeScanIterator' for details

type StateSnapshotIterator

type StateSnapshotIterator struct {
	// contains filtered or unexported fields
}

StateSnapshotIterator implements the interface 'statemgmt.StateSnapshotIterator'

func (*StateSnapshotIterator) Close

func (snapshotItr *StateSnapshotIterator) Close()

Close - see interface 'statemgmt.StateSnapshotIterator' for details

func (*StateSnapshotIterator) GetRawKeyValue

func (snapshotItr *StateSnapshotIterator) GetRawKeyValue() ([]byte, []byte)

GetRawKeyValue - see interface 'statemgmt.StateSnapshotIterator' for details

func (*StateSnapshotIterator) Next

func (snapshotItr *StateSnapshotIterator) Next() bool

Next - see interface 'statemgmt.StateSnapshotIterator' for details

type StateTrie

type StateTrie struct {
	// contains filtered or unexported fields
}

StateTrie defines the trie for the state, a merkle tree where keys and values are stored for fast hash computation.

func NewStateTrie

func NewStateTrie() *StateTrie

NewStateTrie contructs a new empty StateTrie

func (*StateTrie) AddChangesForPersistence

func (stateTrie *StateTrie) AddChangesForPersistence(writeBatch *gorocksdb.WriteBatch) error

AddChangesForPersistence commits current changes to the database

func (*StateTrie) ClearWorkingSet

func (stateTrie *StateTrie) ClearWorkingSet(changesPersisted bool)

ClearWorkingSet clears the existing delta

func (*StateTrie) ComputeCryptoHash

func (stateTrie *StateTrie) ComputeCryptoHash() ([]byte, error)

ComputeCryptoHash returns the hash of the current state trie

func (*StateTrie) Get

func (stateTrie *StateTrie) Get(chaincodeID string, key string) ([]byte, error)

Get the value for a given chaincode ID and key

func (*StateTrie) GetRangeScanIterator

func (stateTrie *StateTrie) GetRangeScanIterator(chaincodeID string, startKey string, endKey string) (statemgmt.RangeScanIterator, error)

GetRangeScanIterator returns an iterator for performing a range scan between the start and end keys

func (*StateTrie) GetStateSnapshotIterator

func (stateTrie *StateTrie) GetStateSnapshotIterator(snapshot *gorocksdb.Snapshot) (statemgmt.StateSnapshotIterator, error)

GetStateSnapshotIterator - method implementation for interface 'statemgmt.HashableState'

func (*StateTrie) Initialize

func (stateTrie *StateTrie) Initialize(configs map[string]interface{}) error

Initialize the state trie with the root key

func (*StateTrie) PerfHintKeyChanged

func (stateTrie *StateTrie) PerfHintKeyChanged(chaincodeID string, key string)

PerfHintKeyChanged is currently a no-op. Can perform pre-fetching of relevant data from db here.

func (*StateTrie) PrepareWorkingSet

func (stateTrie *StateTrie) PrepareWorkingSet(stateDelta *statemgmt.StateDelta) error

PrepareWorkingSet creates the start of a new delta

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL