Documentation ¶
Index ¶
- type DebugStore
- func (d *DebugStore) ArchiveBlock(archiveHeight uint64) error
- func (d *DebugStore) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (d *DebugStore) BlockExists(blockHash []byte) (bool, error)
- func (d *DebugStore) Close() error
- func (d *DebugStore) CommitDbTransaction(txName string) error
- func (d *DebugStore) CreateDatabase(contractName string) error
- func (d *DebugStore) DropDatabase(contractName string) error
- func (d *DebugStore) ExecDdlSql(contractName, sql, version string) error
- func (d *DebugStore) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
- func (d *DebugStore) GetArchivedPivot() uint64
- func (d *DebugStore) GetBlock(height uint64) (*commonPb.Block, error)
- func (d *DebugStore) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
- func (d *DebugStore) GetBlockByTx(txId string) (*commonPb.Block, error)
- func (d *DebugStore) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
- func (d *DebugStore) GetBlockWithRWSets(height uint64) (*storePb.BlockWithRWSet, error)
- func (d *DebugStore) GetContractByName(name string) (*commonPb.Contract, error)
- func (d *DebugStore) GetContractBytecode(name string) ([]byte, error)
- func (d *DebugStore) GetContractDbName(contractName string) string
- func (d *DebugStore) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
- func (d *DebugStore) GetDBHandle(dbName string) protocol.DBHandle
- func (d *DebugStore) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
- func (d *DebugStore) GetHeightByHash(blockHash []byte) (uint64, error)
- func (d *DebugStore) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
- func (d *DebugStore) GetLastBlock() (*commonPb.Block, error)
- func (d *DebugStore) GetLastChainConfig() (*configPb.ChainConfig, error)
- func (d *DebugStore) GetLastConfigBlock() (*commonPb.Block, error)
- func (d *DebugStore) GetMemberExtraData(member *acPb.Member) (*acPb.MemberExtraData, error)
- func (d *DebugStore) GetTx(txId string) (*commonPb.Transaction, error)
- func (d *DebugStore) GetTxConfirmedTime(txId string) (int64, error)
- func (d *DebugStore) GetTxHeight(txId string) (uint64, error)
- func (d *DebugStore) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
- func (d *DebugStore) GetTxInfoWithRWSet(txId string) (*commonPb.TransactionInfoWithRWSet, error)
- func (d *DebugStore) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
- func (d *DebugStore) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
- func (d *DebugStore) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
- func (d *DebugStore) GetTxWithRWSet(txId string) (*commonPb.TransactionWithRWSet, error)
- func (d *DebugStore) InitGenesis(genesisBlock *storePb.BlockWithRWSet) error
- func (d *DebugStore) PutBlock(block *commonPb.Block, txRWSets []*commonPb.TxRWSet) error
- func (d *DebugStore) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
- func (d *DebugStore) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
- func (d *DebugStore) ReadObject(contractName string, key []byte) ([]byte, error)
- func (d *DebugStore) ReadObjects(contractName string, keys [][]byte) ([][]byte, error)
- func (d *DebugStore) RestoreBlocks(serializedBlocks [][]byte) error
- func (d *DebugStore) RollbackDbTransaction(txName string) error
- func (d *DebugStore) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
- func (d *DebugStore) TxExists(txId string) (bool, error)
- func (d *DebugStore) TxExistsInFullDB(txId string) (bool, uint64, error)
- func (d *DebugStore) TxExistsInIncrementDB(txId string, startHeight uint64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugStore ¶
type DebugStore struct {
// contains filtered or unexported fields
}
DebugStore 本实现是用于避开存储模块的内存、CPU和IO的影响的情况下,提供最模拟的基本区块写入,读取等。不能安装合约,写入状态。 @Description:
func NewDebugStore ¶
func NewDebugStore(l protocol.Logger, config *conf.StorageConfig, db protocol.DBHandle) *DebugStore
NewDebugStore add next time @Description: @param l @param config @param db @return *DebugStore
func (*DebugStore) ArchiveBlock ¶
func (d *DebugStore) ArchiveBlock(archiveHeight uint64) error
ArchiveBlock 区块归档 @Description: @receiver d @param archiveHeight @return error
func (*DebugStore) BeginDbTransaction ¶
func (d *DebugStore) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
BeginDbTransaction 开启事务 @Description: @receiver d @param txName @return protocol.SqlDBTransaction @return error
func (*DebugStore) BlockExists ¶
func (d *DebugStore) BlockExists(blockHash []byte) (bool, error)
BlockExists 根据hash 判断区块是否存在 @Description: @receiver d @param blockHash @return bool @return error
func (*DebugStore) Close ¶
func (d *DebugStore) Close() error
Close 关闭db @Description: @receiver d @return error
func (*DebugStore) CommitDbTransaction ¶
func (d *DebugStore) CommitDbTransaction(txName string) error
CommitDbTransaction 提交事务 @Description: @receiver d @param txName @return error
func (*DebugStore) CreateDatabase ¶
func (d *DebugStore) CreateDatabase(contractName string) error
CreateDatabase 创建database @Description: @receiver d @param contractName @return error
func (*DebugStore) DropDatabase ¶
func (d *DebugStore) DropDatabase(contractName string) error
DropDatabase 删除database @Description: @receiver d @param contractName @return error
func (*DebugStore) ExecDdlSql ¶
func (d *DebugStore) ExecDdlSql(contractName, sql, version string) error
ExecDdlSql 执行合约sql @Description: @receiver d @param contractName @param sql @param version @return error
func (*DebugStore) GetAccountTxHistory ¶
func (d *DebugStore) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
GetAccountTxHistory 得到账户历史数据 @Description: @receiver d @param accountId @return protocol.TxHistoryIterator @return error
func (*DebugStore) GetArchivedPivot ¶
func (d *DebugStore) GetArchivedPivot() uint64
GetArchivedPivot add next time @Description: @receiver d @return uint64
func (*DebugStore) GetBlock ¶
func (d *DebugStore) GetBlock(height uint64) (*commonPb.Block, error)
GetBlock 根据区块块高,得到区块 @Description: @receiver d @param height @return *commonPb.Block @return error
func (*DebugStore) GetBlockByHash ¶
func (d *DebugStore) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
GetBlockByHash 根据hash得到block @Description: @receiver d @param blockHash @return *commonPb.Block @return error
func (*DebugStore) GetBlockByTx ¶
func (d *DebugStore) GetBlockByTx(txId string) (*commonPb.Block, error)
GetBlockByTx 通过txid得到区块 @Description: @receiver d @param txId @return *commonPb.Block @return error
func (*DebugStore) GetBlockHeaderByHeight ¶
func (d *DebugStore) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
GetBlockHeaderByHeight 根据块高得到区块header @Description: @receiver d @param height @return *commonPb.BlockHeader @return error
func (*DebugStore) GetBlockWithRWSets ¶
func (d *DebugStore) GetBlockWithRWSets(height uint64) (*storePb.BlockWithRWSet, error)
GetBlockWithRWSets 通过height得到区块和读写集 @Description: @receiver d @param height @return *storePb.BlockWithRWSet @return error
func (*DebugStore) GetContractByName ¶
func (d *DebugStore) GetContractByName(name string) (*commonPb.Contract, error)
GetContractByName 得到合约 @Description: @receiver d @param name @return *commonPb.Contract @return error
func (*DebugStore) GetContractBytecode ¶
func (d *DebugStore) GetContractBytecode(name string) ([]byte, error)
GetContractBytecode 得到合约字节码 @Description: @receiver d @param name @return []byte @return error
func (*DebugStore) GetContractDbName ¶
func (d *DebugStore) GetContractDbName(contractName string) string
GetContractDbName 得到合约对应database @Description: @receiver d @param contractName @return string
func (*DebugStore) GetContractTxHistory ¶
func (d *DebugStore) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
GetContractTxHistory 得到合约历史数据 @Description: @receiver d @param contractName @return protocol.TxHistoryIterator @return error
func (*DebugStore) GetDBHandle ¶
func (d *DebugStore) GetDBHandle(dbName string) protocol.DBHandle
GetDBHandle add next time @Description: @receiver d @param dbName @return protocol.DBHandle
func (*DebugStore) GetDbTransaction ¶
func (d *DebugStore) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
GetDbTransaction 得到当前事务 @Description: @receiver d @param txName @return protocol.SqlDBTransaction @return error
func (*DebugStore) GetHeightByHash ¶
func (d *DebugStore) GetHeightByHash(blockHash []byte) (uint64, error)
GetHeightByHash 根据hash得到块高 @Description: @receiver d @param blockHash @return uint64 @return error
func (*DebugStore) GetHistoryForKey ¶
func (d *DebugStore) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
GetHistoryForKey 得到历史数据 @Description: @receiver d @param contractName @param key @return protocol.KeyHistoryIterator @return error
func (*DebugStore) GetLastBlock ¶
func (d *DebugStore) GetLastBlock() (*commonPb.Block, error)
GetLastBlock 得到最后写入区块 @Description: @receiver d @return *commonPb.Block @return error
func (*DebugStore) GetLastChainConfig ¶
func (d *DebugStore) GetLastChainConfig() (*configPb.ChainConfig, error)
GetLastChainConfig 得到链配置 @Description: @receiver d @return *configPb.ChainConfig @return error
func (*DebugStore) GetLastConfigBlock ¶
func (d *DebugStore) GetLastConfigBlock() (*commonPb.Block, error)
GetLastConfigBlock 得到最后的配置区块 @Description: @receiver d @return *commonPb.Block @return error
func (*DebugStore) GetMemberExtraData ¶
func (d *DebugStore) GetMemberExtraData(member *acPb.Member) (*acPb.MemberExtraData, error)
GetMemberExtraData 得到member @Description: @receiver d @param member @return *acPb.MemberExtraData @return error
func (*DebugStore) GetTx ¶
func (d *DebugStore) GetTx(txId string) (*commonPb.Transaction, error)
GetTx 根据txid得到交易 @Description: @receiver d @param txId @return *commonPb.Transaction @return error
func (*DebugStore) GetTxConfirmedTime ¶
func (d *DebugStore) GetTxConfirmedTime(txId string) (int64, error)
GetTxConfirmedTime 根据txid返回确认时间 @Description: @receiver d @param txId @return int64 @return error
func (*DebugStore) GetTxHeight ¶
func (d *DebugStore) GetTxHeight(txId string) (uint64, error)
GetTxHeight 根据txid返回块高 @Description: @receiver d @param txId @return uint64 @return error
func (*DebugStore) GetTxInfoOnly ¶
func (d *DebugStore) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
GetTxInfoOnly 根据txid 得到交易info @Description: @receiver d @param txId @return *commonPb.TransactionInfo @return error
func (*DebugStore) GetTxInfoWithRWSet ¶
func (d *DebugStore) GetTxInfoWithRWSet(txId string) (*commonPb.TransactionInfoWithRWSet, error)
GetTxInfoWithRWSet return tx and tx info and rw set @Description: @receiver d @param txId @return *commonPb.TransactionInfoWithRWSet @return error
func (*DebugStore) GetTxRWSet ¶
func (d *DebugStore) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
GetTxRWSet 根据txid得到读写集 @Description: @receiver d @param txId @return *commonPb.TxRWSet @return error
func (*DebugStore) GetTxRWSetsByHeight ¶
func (d *DebugStore) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
GetTxRWSetsByHeight 根据块高,返回读写集 @Description: @receiver d @param height @return []*commonPb.TxRWSet @return error
func (*DebugStore) GetTxWithInfo ¶
func (d *DebugStore) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
GetTxWithInfo 根据txid得到 交易info @Description: @receiver d @param txId @return *commonPb.TransactionInfo @return error
func (*DebugStore) GetTxWithRWSet ¶
func (d *DebugStore) GetTxWithRWSet(txId string) (*commonPb.TransactionWithRWSet, error)
GetTxWithRWSet return tx and it's rw set @Description: @receiver d @param txId @return *commonPb.TransactionWithRWSet @return error
func (*DebugStore) InitGenesis ¶
func (d *DebugStore) InitGenesis(genesisBlock *storePb.BlockWithRWSet) error
InitGenesis 创世块初始化写入 @Description: @receiver d @param genesisBlock @return error
func (*DebugStore) PutBlock ¶
PutBlock 写区块和读写集 @Description: @receiver d @param block @param txRWSets @return error
func (*DebugStore) QueryMulti ¶
func (d *DebugStore) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
QueryMulti 根据合约,sql,value得到对应 多行数据 @Description: @receiver d @param contractName @param sql @param values @return protocol.SqlRows @return error
func (*DebugStore) QuerySingle ¶
func (d *DebugStore) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
QuerySingle 根据合约,sql,value得到对应行数据 @Description: @receiver d @param contractName @param sql @param values @return protocol.SqlRow @return error
func (*DebugStore) ReadObject ¶
func (d *DebugStore) ReadObject(contractName string, key []byte) ([]byte, error)
ReadObject 读合约key对应value @Description: @receiver d @param contractName @param key @return []byte @return error
func (*DebugStore) ReadObjects ¶ added in v2.3.0
func (d *DebugStore) ReadObjects(contractName string, keys [][]byte) ([][]byte, error)
ReadObjects 读合约keys对应values @Description: @receiver d @param contractName @param startKey @param limit @return protocol.StateIterator @return error
func (*DebugStore) RestoreBlocks ¶
func (d *DebugStore) RestoreBlocks(serializedBlocks [][]byte) error
RestoreBlocks 转储区块 @Description: @receiver d @param serializedBlocks @return error
func (*DebugStore) RollbackDbTransaction ¶
func (d *DebugStore) RollbackDbTransaction(txName string) error
RollbackDbTransaction 回滚事务 @Description: @receiver d @param txName @return error
func (*DebugStore) SelectObject ¶
func (d *DebugStore) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
SelectObject 合约范围查询 @Description: @receiver d @param contractName @param startKey @param limit @return protocol.StateIterator @return error
func (*DebugStore) TxExists ¶
func (d *DebugStore) TxExists(txId string) (bool, error)
TxExists 交易过滤,判断是否存在 @Description: @receiver d @param txId @return bool @return error