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) 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的影响的情况下,提供最模拟的基本区块写入,读取等。不能安装合约,写入状态。
func NewDebugStore ¶
func NewDebugStore(l protocol.Logger, config *conf.StorageConfig, db protocol.DBHandle) *DebugStore
func (*DebugStore) ArchiveBlock ¶
func (d *DebugStore) ArchiveBlock(archiveHeight uint64) error
区块归档
func (*DebugStore) BeginDbTransaction ¶
func (d *DebugStore) BeginDbTransaction(txName string) (protocol.SqlDBTransaction, error)
开启事务
func (*DebugStore) BlockExists ¶
func (d *DebugStore) BlockExists(blockHash []byte) (bool, error)
根据hash 判断区块是否存在
func (*DebugStore) CommitDbTransaction ¶
func (d *DebugStore) CommitDbTransaction(txName string) error
提交事务
func (*DebugStore) CreateDatabase ¶
func (d *DebugStore) CreateDatabase(contractName string) error
创建database
func (*DebugStore) DropDatabase ¶
func (d *DebugStore) DropDatabase(contractName string) error
删除database
func (*DebugStore) ExecDdlSql ¶
func (d *DebugStore) ExecDdlSql(contractName, sql, version string) error
执行合约sql
func (*DebugStore) GetAccountTxHistory ¶
func (d *DebugStore) GetAccountTxHistory(accountId []byte) (protocol.TxHistoryIterator, error)
得到账户历史数据
func (*DebugStore) GetArchivedPivot ¶
func (d *DebugStore) GetArchivedPivot() uint64
func (*DebugStore) GetBlock ¶
func (d *DebugStore) GetBlock(height uint64) (*commonPb.Block, error)
根据区块块高,得到区块
func (*DebugStore) GetBlockByHash ¶
func (d *DebugStore) GetBlockByHash(blockHash []byte) (*commonPb.Block, error)
根据hash得到block
func (*DebugStore) GetBlockByTx ¶
func (d *DebugStore) GetBlockByTx(txId string) (*commonPb.Block, error)
通过txid得到区块
func (*DebugStore) GetBlockHeaderByHeight ¶
func (d *DebugStore) GetBlockHeaderByHeight(height uint64) (*commonPb.BlockHeader, error)
根据块高得到区块header
func (*DebugStore) GetBlockWithRWSets ¶
func (d *DebugStore) GetBlockWithRWSets(height uint64) (*storePb.BlockWithRWSet, error)
通过height得到区块和读写集
func (*DebugStore) GetContractByName ¶
func (d *DebugStore) GetContractByName(name string) (*commonPb.Contract, error)
得到合约
func (*DebugStore) GetContractBytecode ¶
func (d *DebugStore) GetContractBytecode(name string) ([]byte, error)
得到合约字节码
func (*DebugStore) GetContractDbName ¶
func (d *DebugStore) GetContractDbName(contractName string) string
得到合约对应database
func (*DebugStore) GetContractTxHistory ¶
func (d *DebugStore) GetContractTxHistory(contractName string) (protocol.TxHistoryIterator, error)
得到合约历史数据
func (*DebugStore) GetDBHandle ¶
func (d *DebugStore) GetDBHandle(dbName string) protocol.DBHandle
func (*DebugStore) GetDbTransaction ¶
func (d *DebugStore) GetDbTransaction(txName string) (protocol.SqlDBTransaction, error)
得到当前事务
func (*DebugStore) GetHeightByHash ¶
func (d *DebugStore) GetHeightByHash(blockHash []byte) (uint64, error)
根据hash得到块高
func (*DebugStore) GetHistoryForKey ¶
func (d *DebugStore) GetHistoryForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
得到历史数据
func (*DebugStore) GetLastBlock ¶
func (d *DebugStore) GetLastBlock() (*commonPb.Block, error)
得到最后写入区块
func (*DebugStore) GetLastChainConfig ¶
func (d *DebugStore) GetLastChainConfig() (*configPb.ChainConfig, error)
得到链配置
func (*DebugStore) GetLastConfigBlock ¶
func (d *DebugStore) GetLastConfigBlock() (*commonPb.Block, error)
得到最后的配置区块
func (*DebugStore) GetMemberExtraData ¶
func (d *DebugStore) GetMemberExtraData(member *acPb.Member) (*acPb.MemberExtraData, error)
得到member
func (*DebugStore) GetTx ¶
func (d *DebugStore) GetTx(txId string) (*commonPb.Transaction, error)
根据txid得到交易
func (*DebugStore) GetTxConfirmedTime ¶
func (d *DebugStore) GetTxConfirmedTime(txId string) (int64, error)
根据txid返回确认时间
func (*DebugStore) GetTxHeight ¶
func (d *DebugStore) GetTxHeight(txId string) (uint64, error)
根据txid返回块高
func (*DebugStore) GetTxInfoOnly ¶
func (d *DebugStore) GetTxInfoOnly(txId string) (*commonPb.TransactionInfo, error)
根据txid 得到交易info
func (*DebugStore) GetTxInfoWithRWSet ¶
func (d *DebugStore) GetTxInfoWithRWSet(txId string) (*commonPb.TransactionInfoWithRWSet, error)
GetTxInfoWithRWSet return tx and tx info and rw set
func (*DebugStore) GetTxRWSet ¶
func (d *DebugStore) GetTxRWSet(txId string) (*commonPb.TxRWSet, error)
根据txid得到读写集
func (*DebugStore) GetTxRWSetsByHeight ¶
func (d *DebugStore) GetTxRWSetsByHeight(height uint64) ([]*commonPb.TxRWSet, error)
根据块高,返回读写集
func (*DebugStore) GetTxWithInfo ¶
func (d *DebugStore) GetTxWithInfo(txId string) (*commonPb.TransactionInfo, error)
根据txid得到 交易info
func (*DebugStore) GetTxWithRWSet ¶
func (d *DebugStore) GetTxWithRWSet(txId string) (*commonPb.TransactionWithRWSet, error)
GetTxWithRWSet return tx and it's rw set
func (*DebugStore) InitGenesis ¶
func (d *DebugStore) InitGenesis(genesisBlock *storePb.BlockWithRWSet) error
创世块初始化写入
func (*DebugStore) PutBlock ¶
写区块和读写集
func (*DebugStore) QueryMulti ¶
func (d *DebugStore) QueryMulti(contractName, sql string, values ...interface{}) (protocol.SqlRows, error)
根据合约,sql,value得到对应 多行数据
func (*DebugStore) QuerySingle ¶
func (d *DebugStore) QuerySingle(contractName, sql string, values ...interface{}) (protocol.SqlRow, error)
根据合约,sql,value得到对应行数据
func (*DebugStore) ReadObject ¶
func (d *DebugStore) ReadObject(contractName string, key []byte) ([]byte, error)
读合约key对应value
func (*DebugStore) RestoreBlocks ¶
func (d *DebugStore) RestoreBlocks(serializedBlocks [][]byte) error
转储区块
func (*DebugStore) RollbackDbTransaction ¶
func (d *DebugStore) RollbackDbTransaction(txName string) error
回滚事务
func (*DebugStore) SelectObject ¶
func (d *DebugStore) SelectObject(contractName string, startKey []byte, limit []byte) (protocol.StateIterator, error)
合约范围查询
Click to show internal directories.
Click to hide internal directories.