statekvdb

package
v0.0.0-...-8b03266 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 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

func NewStateKvDB

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

func (*StateKvDB) BeginDbTransaction

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

func (*StateKvDB) Close

func (s *StateKvDB) Close()

Close is used to close database

func (*StateKvDB) CommitBlock

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

CommitBlock commits the state in an atomic operation

func (*StateKvDB) CommitDbTransaction

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

func (*StateKvDB) CreateDatabase

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

func (*StateKvDB) DirectFlushDB

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

flush keyMap data direct write to db, not write cache

func (*StateKvDB) DropDatabase

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

DropDatabase 删除一个合约对应的数据库

func (*StateKvDB) ExecDdlSql

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

func (*StateKvDB) GetChainConfig

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

func (*StateKvDB) GetContractDbName

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

GetContractDbName 获得一个合约对应的状态数据库名

func (*StateKvDB) GetDbTransaction

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

func (*StateKvDB) GetLastSavepoint

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

GetLastSavepoint returns the last block height

func (*StateKvDB) GetMemberExtraData

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

func (*StateKvDB) InitGenesis

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

创世区块写入

func (*StateKvDB) QueryMulti

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

func (*StateKvDB) QuerySingle

func (s *StateKvDB) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, 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.

func (*StateKvDB) RollbackDbTransaction

func (s *StateKvDB) RollbackDbTransaction(txName string) 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.

Jump to

Keyboard shortcuts

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