statekvdb

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StateKvDB

type StateKvDB struct {

	//sync.Mutex
	sync.RWMutex
	// contains filtered or unexported fields
}

StateKvDB provider a implementation of `statedb.StateDB` This implementation provides a key-value based data model @Description:

func NewStateKvDB

func NewStateKvDB(chainId string, handle protocol.DBHandle, logger protocol.Logger,
	storeConfig *conf.StorageConfig) *StateKvDB

NewStateKvDB construct StateKvDB @Description: @param chainId @param handle @param logger @param storeConfig @return *StateKvDB

func (*StateKvDB) BeginDbTransaction

func (s *StateKvDB) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)

BeginDbTransaction not implement @Description: @receiver s @param txName @return protocol.SqlDBTransaction @return error

func (*StateKvDB) Close

func (s *StateKvDB) Close()

Close is used to close database @Description: @receiver s

func (*StateKvDB) CommitBlock

func (s *StateKvDB) CommitBlock(blockWithRWSet *serialization.BlockWithSerializedInfo, isCache bool) error

CommitBlock commits the state in an atomic operation @Description: @receiver s @param blockWithRWSet @param isCache @return error

func (*StateKvDB) CommitDbTransaction

func (s *StateKvDB) CommitDbTransaction(txName string) error

CommitDbTransaction not implement @Description: @receiver s @param txName @return error

func (*StateKvDB) CreateDatabase

func (s *StateKvDB) CreateDatabase(contractName string) error

CreateDatabase not implement @Description: @receiver s @param contractName @return error

func (*StateKvDB) DirectFlushDB

func (s *StateKvDB) DirectFlushDB(keyMap map[string][]byte) error

DirectFlushDB flush keyMap data direct write to db, not write cache @Description: @receiver s @param keyMap @return error

func (*StateKvDB) DropDatabase

func (s *StateKvDB) DropDatabase(contractName string) error

DropDatabase 删除一个合约对应的数据库 @Description: @receiver s @param contractName @return error

func (*StateKvDB) ExecDdlSql

func (s *StateKvDB) ExecDdlSql(contractName, sql, version string) error

ExecDdlSql not implement @Description: @receiver s @param contractName @param sql @param version @return error

func (*StateKvDB) GetChainConfig

func (s *StateKvDB) GetChainConfig() (*configPb.ChainConfig, error)

GetChainConfig return chain config @Description: @receiver s @return *configPb.ChainConfig @return error

func (*StateKvDB) GetContractDbName

func (s *StateKvDB) GetContractDbName(contractName string) string

GetContractDbName 获得一个合约对应的状态数据库名 @Description: @receiver s @param contractName @return string

func (*StateKvDB) GetDbTransaction

func (s *StateKvDB) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)

GetDbTransaction not implement @Description: @receiver s @param txName @return protocol.SqlDBTransaction @return error

func (*StateKvDB) GetLastSavepoint

func (s *StateKvDB) GetLastSavepoint() (uint64, error)

GetLastSavepoint returns the last block height @Description: @receiver b @return uint64 @return error

func (*StateKvDB) GetMemberExtraData

func (s *StateKvDB) GetMemberExtraData(member *accesscontrol.Member) (*accesscontrol.MemberExtraData, error)

GetMemberExtraData retrieve memberinfo from kv db @Description: @receiver s @param member @return *accesscontrol.MemberExtraData @return error

func (*StateKvDB) GetSnapshotIterator

func (s *StateKvDB) GetSnapshotIterator() ([]protocol.Iterator, error)

GetSnapshotIterator returns iterator array that contains all the key-values . todo: possibly [startKey,endKey) can not cover the full range,so it maybe be a bug

func (*StateKvDB) ImportSetSavePoint

func (s *StateKvDB) ImportSetSavePoint(height uint64) error

ImportSetSavePoint set up savePoint when import snapshot

func (*StateKvDB) ImportSnapshot

func (s *StateKvDB) ImportSnapshot(key, value []byte) error

ImportSnapshot import data from snapshot to state db

func (*StateKvDB) InitGenesis

func (s *StateKvDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error

InitGenesis 创世区块写入 @Description: @receiver s @param genesisBlock @return error

func (*StateKvDB) QueryMulti

func (s *StateKvDB) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)

QueryMulti not implement @Description: @receiver s @param contractName @param sql @param values @return protocol.SqlRows @return error

func (*StateKvDB) QuerySingle

func (s *StateKvDB) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)

QuerySingle not implement @Description: @receiver s @param contractName @param sql @param values @return protocol.SqlRow @return error

func (*StateKvDB) ReadObject

func (s *StateKvDB) ReadObject(contractName string, key []byte) ([]byte, error)

ReadObject returns the state value for given contract name and key, or returns nil if none exists. @Description: @receiver s @param contractName @param key @return []byte @return error

func (*StateKvDB) ReadObjects

func (s *StateKvDB) ReadObjects(contractName string, keys [][]byte) ([][]byte, error)

ReadObjects returns the state values for given contract name and keys

func (*StateKvDB) RollbackDbTransaction

func (s *StateKvDB) RollbackDbTransaction(txName string) error

RollbackDbTransaction not implement @Description: @receiver s @param txName @return error

func (*StateKvDB) SelectObject

func (s *StateKvDB) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)

SelectObject returns an iterator that contains all the key-values between given key ranges. startKey is included in the results and limit is excluded. @Description: @receiver s @param contractName @param startKey @param limit @return protocol.StateIterator @return error

Jump to

Keyboard shortcuts

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