Documentation ¶
Index ¶
- type StateKvDB
- func (s *StateKvDB) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (s *StateKvDB) Close()
- func (s *StateKvDB) CommitBlock(blockWithRWSet *serialization.BlockWithSerializedInfo, isCache bool) error
- func (s *StateKvDB) CommitDbTransaction(txName string) error
- func (s *StateKvDB) CreateDatabase(contractName string) error
- func (s *StateKvDB) DirectFlushDB(keyMap map[string][]byte) error
- func (s *StateKvDB) DropDatabase(contractName string) error
- func (s *StateKvDB) ExecDdlSql(contractName, sql, version string) error
- func (s *StateKvDB) GetChainConfig() (*configPb.ChainConfig, error)
- func (s *StateKvDB) GetContractDbName(contractName string) string
- func (s *StateKvDB) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (b *StateKvDB) GetLastSavepoint() (uint64, error)
- func (s *StateKvDB) GetMemberExtraData(member *accesscontrol.Member) (*accesscontrol.MemberExtraData, error)
- func (s *StateKvDB) InitGenesis(genesisBlock *serialization.BlockWithSerializedInfo) error
- func (s *StateKvDB) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
- func (s *StateKvDB) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
- func (s *StateKvDB) ReadObject(contractName string, key []byte) ([]byte, error)
- func (s *StateKvDB) ReadObjects(contractName string, keys [][]byte) ([][]byte, error)
- func (s *StateKvDB) RollbackDbTransaction(txName string) error
- func (s *StateKvDB) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateKvDB ¶
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 ¶
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 ¶
CommitDbTransaction not implement @Description: @receiver s @param txName @return error
func (*StateKvDB) CreateDatabase ¶
CreateDatabase not implement @Description: @receiver s @param contractName @return error
func (*StateKvDB) DirectFlushDB ¶ added in v2.2.0
DirectFlushDB flush keyMap data direct write to db, not write cache @Description: @receiver s @param keyMap @return error
func (*StateKvDB) DropDatabase ¶
DropDatabase 删除一个合约对应的数据库 @Description: @receiver s @param contractName @return error
func (*StateKvDB) ExecDdlSql ¶
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 ¶
GetContractDbName 获得一个合约对应的状态数据库名 @Description: @receiver s @param contractName @return string
func (*StateKvDB) GetDbTransaction ¶
GetDbTransaction not implement @Description: @receiver s @param txName @return protocol.SqlDBTransaction @return error
func (*StateKvDB) GetLastSavepoint ¶
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) 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 ¶
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 ¶ added in v2.3.0
ReadObjects returns the state values for given contract name and keys
func (*StateKvDB) RollbackDbTransaction ¶
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