test

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: 9 Imported by: 0

Documentation

Index

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) DoHotColdDataSeparation

func (d *DebugStore) DoHotColdDataSeparation(startHeight uint64, endHeight uint64) (string, error)

DoHotColdDataSeparation do move hot block to archive file system

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) GetArchiveStatus added in v3.0.1

func (d *DebugStore) GetArchiveStatus() (*storePb.ArchiveStatus, error)

GetArchiveStatus add next time

@Description:
@receiver d
@return *storePb.ArchiveStatus
@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) GetHotColdDataSeparationJobByID

func (d *DebugStore) GetHotColdDataSeparationJobByID(jobID string) (storePb.ArchiveJob, error)

GetHotColdDataSeparationJobByID got job info by job id

func (*DebugStore) GetHotColdDataSeparationMaxHeight added in v3.0.1

func (d *DebugStore) GetHotColdDataSeparationMaxHeight() (uint64, error)

GetHotColdDataSeparationMaxHeight get the max height which can be used for do hot-cold data separations

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) GetLastHeight added in v3.0.1

func (d *DebugStore) GetLastHeight() (uint64, error)

GetLastHeight add next time

@Description:
@receiver d
@return uint64
@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) GetSnapshotStatus

func (d *DebugStore) GetSnapshotStatus() uint64

GetSnapshotStatus get snapshot status

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) MakeSnapshot

func (d *DebugStore) MakeSnapshot(snapshotHeight uint64) error

MakeSnapshot make a snapshot by height

func (*DebugStore) PutBlock

func (d *DebugStore) PutBlock(block *commonPb.Block, txRWSets []*commonPb.TxRWSet) error

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

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

func (*DebugStore) TxExistsInFullDB

func (d *DebugStore) TxExistsInFullDB(txId string) (bool, uint64, error)

TxExistsInFullDB 判断交易是否存在 @Description: @receiver d @param txId @return bool @return uint64 @return error

func (*DebugStore) TxExistsInIncrementDB

func (d *DebugStore) TxExistsInIncrementDB(txId string, startHeight uint64) (bool, error)

TxExistsInIncrementDB 增量防重 @Description: @receiver d @param txId @param startHeight @return bool @return error

func (*DebugStore) TxExistsInIncrementDBState

func (d *DebugStore) TxExistsInIncrementDBState(txId string, startHeight uint64) (bool, bool, error)

TxExistsInIncrementDBState returns true if the tx exist from starHeight to the latest committed block, or returns false if none exists. @Description: @receiver bs @param txId @param startHeight @return bool @return bool ,true is inside the window, false is outside the window. @return error

Jump to

Keyboard shortcuts

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