Documentation ¶
Index ¶
- Constants
- type BlockContract
- type BlockRuntime
- func (r *BlockRuntime) GetAccountTxHistory(context protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetArchiveBlockHeight(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetArchiveStatus(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockByHash(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockByHeight(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockByTxId(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockHeaderByHeight(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockHeightByHash(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockHeightByTxId(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockWithTxRWSetsByHash(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetBlockWithTxRWSetsByHeight(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetChainInfo(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetContractTxHistory(context protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetFullBlockByHeight(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetLastBlock(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetLastConfigBlock(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetMerklePathByTxId(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetNodeChainList(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (r *BlockRuntime) GetTxByTxId(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- type BlockRuntimeParam
- type StateQueryRuntime
- func (s *StateQueryRuntime) GetStateByKey(context protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (s *StateQueryRuntime) GetStateByPrefix(context protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
- func (s *StateQueryRuntime) GetStateKeyHistory(context protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
Constants ¶
const (
// TRUE string const
TRUE = "true"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockContract ¶
type BlockContract struct { common.BaseContract // contains filtered or unexported fields }
BlockContract 区块查询合约对象
func NewBlockContract ¶
func NewBlockContract(log protocol.Logger) *BlockContract
NewBlockContract BlockContract构造函数 @param log @return *BlockContract
type BlockRuntime ¶
type BlockRuntime struct {
// contains filtered or unexported fields
}
BlockRuntime Block合约运行时
func (*BlockRuntime) GetAccountTxHistory ¶ added in v3.0.1
func (r *BlockRuntime) GetAccountTxHistory(context protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetAccountTxHistory 获得账户交易历史,如果没有传入账户地址,则默认使用当前交易的发送者地址; 如果传入了CONTRACT_NAME,则只查询该合约的交易历史 @param context @param parameters @return []byte @return error
func (*BlockRuntime) GetArchiveBlockHeight ¶
func (r *BlockRuntime) GetArchiveBlockHeight(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
GetArchiveBlockHeight 获得已经归档的区块高度 @param context @param params @return []byte @return error
func (*BlockRuntime) GetArchiveStatus ¶ added in v3.0.1
func (r *BlockRuntime) GetArchiveStatus(context protocol.TxSimContext, params map[string][]byte) ([]byte, error)
GetArchiveStatus 获得归档信息 @param context @param params @return []byte @return error
func (*BlockRuntime) GetBlockByHash ¶
func (r *BlockRuntime) GetBlockByHash(txSimContext protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetBlockByHash 根据区块Hash获得区块 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetBlockByHeight ¶
func (r *BlockRuntime) GetBlockByHeight(txSimContext protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetBlockByHeight 根据高度查询区块 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetBlockByTxId ¶
func (r *BlockRuntime) GetBlockByTxId(txSimContext protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetBlockByTxId 根据TxID获得所在的区块 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetBlockHeaderByHeight ¶
func (r *BlockRuntime) GetBlockHeaderByHeight(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
GetBlockHeaderByHeight 根据区块高度获得区块头 @param txSimContext @param params @return []byte @return error
func (*BlockRuntime) GetBlockHeightByHash ¶
func (r *BlockRuntime) GetBlockHeightByHash(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
GetBlockHeightByHash 根据区块Hash获得该区块的高度 @param txSimContext @param params @return []byte @return error
func (*BlockRuntime) GetBlockHeightByTxId ¶
func (r *BlockRuntime) GetBlockHeightByTxId(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
GetBlockHeightByTxId 根据TxID获得所在的区块高度 @param txSimContext @param params @return []byte @return error
func (*BlockRuntime) GetBlockWithTxRWSetsByHash ¶
func (r *BlockRuntime) GetBlockWithTxRWSetsByHash(txSimContext protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetBlockWithTxRWSetsByHash 根据区块Hash获得区块和读写集 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetBlockWithTxRWSetsByHeight ¶
func (r *BlockRuntime) GetBlockWithTxRWSetsByHeight(txSimContext protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetBlockWithTxRWSetsByHeight 根据高度查询区块和读写集 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetChainInfo ¶
func (r *BlockRuntime) GetChainInfo(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
GetChainInfo 获得链信息 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetContractTxHistory ¶ added in v3.0.1
func (r *BlockRuntime) GetContractTxHistory(context protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetContractTxHistory 获得合约交易历史 @param context @param parameters @return []byte @return error
func (*BlockRuntime) GetFullBlockByHeight ¶
func (r *BlockRuntime) GetFullBlockByHeight(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error)
GetFullBlockByHeight 获得完整的区块信息(包括了合约事件,而且不得裁剪) @param txSimContext @param params @return []byte @return error
func (*BlockRuntime) GetLastBlock ¶
func (r *BlockRuntime) GetLastBlock(txSimContext protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
GetLastBlock 获得最新的区块 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetLastConfigBlock ¶
func (r *BlockRuntime) GetLastConfigBlock(txSimContext protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetLastConfigBlock 获得最新的配置区块 @param txSimContext @param parameters @return []byte @return error
func (*BlockRuntime) GetMerklePathByTxId ¶
func (r *BlockRuntime) GetMerklePathByTxId(txSimContext protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetMerklePathByTxId 获得一个交易的默克尔验证路径 @param txSimContext @param parameters TxID @return []byte @return error
type BlockRuntimeParam ¶
type BlockRuntimeParam struct {
// contains filtered or unexported fields
}
BlockRuntimeParam 查询参数
type StateQueryRuntime ¶
type StateQueryRuntime struct {
// contains filtered or unexported fields
}
StateQueryRuntime 对状态数据库的查询
func (*StateQueryRuntime) GetStateByKey ¶
func (s *StateQueryRuntime) GetStateByKey(context protocol.TxSimContext, parameters map[string][]byte) ([]byte, error)
GetStateByKey 根据合约名和Key获得对应的Value @param context @param parameters @return []byte @return error
func (*StateQueryRuntime) GetStateByPrefix ¶
func (s *StateQueryRuntime) GetStateByPrefix(context protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetStateByPrefix 根据合约名和Key前缀,获得满足条件的KV列表 @param context @param parameters @return []byte @return error
func (*StateQueryRuntime) GetStateKeyHistory ¶ added in v3.0.1
func (s *StateQueryRuntime) GetStateKeyHistory(context protocol.TxSimContext, parameters map[string][]byte) ( []byte, error)
GetStateKeyHistory 根据合约名和Key,获得Key的历史记录 @param context @param parameters @return []byte json格式的KeyModification列表 @return error