Documentation ¶
Index ¶
- Constants
- Variables
- func GetMsgAccountKey(addr []byte) []byte
- func GetMsgStateKey(addr common.Address, key []byte) []byte
- func GetWatchLruSize() int
- func IsWatcherEnabled() bool
- type Batch
- type Block
- type BlockNonce
- type CodeInfo
- type DelAccMsg
- type LazyValueMarshaler
- type MsgAccount
- type MsgBlock
- type MsgBlockInfo
- type MsgCode
- type MsgCodeByHash
- type MsgContractBlockedListItem
- type MsgContractDeploymentWhitelistItem
- type MsgContractMethodBlockedListItem
- type MsgEthTx
- type MsgLatestHeight
- type MsgParams
- type MsgState
- type MsgTransactionReceipt
- type Querier
- func (q Querier) DeleteAccountFromRdb(addr sdk.AccAddress)
- func (q Querier) DeleteStateFromRdb(addr common.Address, key []byte)
- func (q *Querier) Enable(sw bool)
- func (q Querier) GetAccount(addr sdk.AccAddress) (*types.EthAccount, error)
- func (q Querier) GetAccountFromRdb(addr sdk.AccAddress) (*types.EthAccount, error)
- func (q Querier) GetBlockByHash(hash common.Hash, fullTx bool) (*Block, error)
- func (q Querier) GetBlockByNumber(number uint64, fullTx bool) (*Block, error)
- func (q Querier) GetBlockHashByNumber(number uint64) (common.Hash, error)
- func (q Querier) GetCode(contractAddr common.Address, height uint64) ([]byte, error)
- func (q Querier) GetCodeByHash(codeHash []byte) ([]byte, error)
- func (q Querier) GetContractMethodBlockedList(key []byte) ([]byte, error)
- func (q Querier) GetLatestBlockNumber() (uint64, error)
- func (q Querier) GetParams() (*evmtypes.Params, error)
- func (q Querier) GetState(key []byte) ([]byte, error)
- func (q Querier) GetStateFromRdb(key []byte) ([]byte, error)
- func (q Querier) GetTransactionByBlockHashAndIndex(hash common.Hash, idx uint) (*Transaction, error)
- func (q Querier) GetTransactionByBlockNumberAndIndex(number uint64, idx uint) (*Transaction, error)
- func (q Querier) GetTransactionByHash(hash common.Hash) (*Transaction, error)
- func (q Querier) GetTransactionReceipt(hash common.Hash) (*TransactionReceipt, error)
- func (q Querier) GetTransactionsByBlockNumber(number, offset, limit uint64) ([]*Transaction, error)
- func (q Querier) HasContractBlockedList(key []byte) bool
- func (q Querier) HasContractDeploymentWhitelist(key []byte) bool
- func (q Querier) MustGetAccount(addr sdk.AccAddress) (*types.EthAccount, error)
- func (q Querier) MustGetState(addr common.Address, key []byte) ([]byte, error)
- type Transaction
- type TransactionReceipt
- type WatchData
- type WatchMessage
- type WatchStore
- func (w WatchStore) Delete(key []byte)
- func (w WatchStore) Get(key []byte) ([]byte, error)
- func (w WatchStore) GetUnsafe(key []byte, processor dbm.UnsafeValueProcessor) (interface{}, error)
- func (w WatchStore) Has(key []byte) bool
- func (w WatchStore) Iterator(start, end []byte) dbm.Iterator
- func (w WatchStore) Set(key []byte, value []byte)
- type Watcher
- func (w *Watcher) AddDelAccMsg(account auth.Account, isDirectly bool)
- func (w *Watcher) CheckWatchDB(keys [][]byte, mode string)
- func (w *Watcher) Commit()
- func (w *Watcher) CommitAccountToRpcDb(account auth.Account)
- func (w *Watcher) CommitCodeHashToDb(hash []byte, code []byte)
- func (w *Watcher) CommitStateToRpcDb(addr common.Address, key, value []byte)
- func (w *Watcher) CommitWatchData(data WatchData, delayEraseKey [][]byte)
- func (w *Watcher) DeleteAccount(addr sdk.AccAddress)
- func (w *Watcher) DeleteContractBlockedList(addr sdk.AccAddress)
- func (w *Watcher) DeleteContractDeploymentWhitelist(addr sdk.AccAddress)
- func (w *Watcher) Enable(sw bool)
- func (w *Watcher) Enabled() bool
- func (w *Watcher) ExecuteDelayEraseKey(delayEraseKey [][]byte)
- func (w *Watcher) Finalize()
- func (w *Watcher) GetBloomDataPoint() *[]*evmtypes.KV
- func (w *Watcher) GetWatchDataFunc() func() ([]byte, error)
- func (w *Watcher) IsFirstUse() bool
- func (w *Watcher) NewHeight(height uint64, blockHash common.Hash, header types.Header)
- func (w *Watcher) Reset()
- func (w *Watcher) SaveAccount(account auth.Account, isDirectly bool)
- func (w *Watcher) SaveBlock(bloom ethtypes.Bloom)
- func (w *Watcher) SaveContractBlockedListItem(addr sdk.AccAddress)
- func (w *Watcher) SaveContractCode(addr common.Address, code []byte)
- func (w *Watcher) SaveContractCodeByHash(hash []byte, code []byte)
- func (w *Watcher) SaveContractDeploymentWhitelistItem(addr sdk.AccAddress)
- func (w *Watcher) SaveContractMethodBlockedListItem(addr sdk.AccAddress, methods []byte)
- func (w *Watcher) SaveEthereumTx(msg *evmtypes.MsgEthereumTx, txHash common.Hash, index uint64)
- func (w *Watcher) SaveLatestHeight(height uint64)
- func (w *Watcher) SaveParams(params evmtypes.Params)
- func (w *Watcher) SaveState(addr common.Address, key, value []byte)
- func (w *Watcher) SaveTransactionReceipt(status uint32, msg *evmtypes.MsgEthereumTx, txHash common.Hash, txIndex uint64, ...)
- func (w *Watcher) SetWatchDataFunc()
- func (w *Watcher) UnmarshalWatchData(wdByte []byte) (interface{}, error)
- func (w *Watcher) UpdateBlockTxs(txHash common.Hash)
- func (w *Watcher) UpdateCumulativeGas(txIndex, gasUsed uint64)
- func (w *Watcher) UseWatchData(watchData interface{})
- func (w *Watcher) Used()
Constants ¶
const ( FlagFastQuery = "fast-query" FlagFastQueryLru = "fast-lru" FlagDBBackend = "db_backend" FlagCheckWd = "check_watchdb" WatchDbDir = "data" WatchDBName = "watch" )
const ( TypeOthers = uint32(1) TypeState = uint32(2) TypeDelete = uint32(3) )
const MsgFunctionDisable = "fast query function has been disabled"
Variables ¶
var ( PrefixState = []byte{0x08} KeyLatestHeight = "LatestHeight" TransactionSuccess = uint32(1) TransactionFailed = uint32(0) )
Functions ¶
func GetMsgAccountKey ¶ added in v0.18.7
func GetWatchLruSize ¶ added in v0.18.8
func GetWatchLruSize() int
func IsWatcherEnabled ¶
func IsWatcherEnabled() bool
Types ¶
type Batch ¶ added in v1.0.0
type Batch struct { Key []byte `json:"key"` Value []byte `json:"value"` TypeValue uint32 `json:"type_value"` }
func (*Batch) MarshalToAmino ¶ added in v1.1.6
MarshalToAmino marshal batch data to amino bytes
func (*Batch) UnmarshalFromAmino ¶ added in v1.1.6
UnmarshalFromAmino unmarshal amino bytes to this object
type Block ¶ added in v1.2.0
type Block struct { Number hexutil.Uint64 `json:"number"` Hash common.Hash `json:"hash"` ParentHash common.Hash `json:"parentHash"` Nonce BlockNonce `json:"nonce"` UncleHash common.Hash `json:"sha3Uncles"` LogsBloom ethtypes.Bloom `json:"logsBloom"` TransactionsRoot common.Hash `json:"transactionsRoot"` StateRoot common.Hash `json:"stateRoot"` Miner common.Address `json:"miner"` MixHash common.Hash `json:"mixHash"` Difficulty hexutil.Uint64 `json:"difficulty"` TotalDifficulty hexutil.Uint64 `json:"totalDifficulty"` ExtraData hexutil.Bytes `json:"extraData"` Size hexutil.Uint64 `json:"size"` GasLimit hexutil.Uint64 `json:"gasLimit"` GasUsed *hexutil.Big `json:"gasUsed"` Timestamp hexutil.Uint64 `json:"timestamp"` Uncles []common.Hash `json:"uncles"` ReceiptsRoot common.Hash `json:"receiptsRoot"` Transactions interface{} `json:"transactions"` }
Block represents a transaction returned to RPC clients.
type BlockNonce ¶
type BlockNonce [8]byte
A BlockNonce is a 64-bit hash which proves (combined with the mix-hash) that a sufficient amount of computation has been carried out on a block.
func EncodeNonce ¶
func EncodeNonce(i uint64) BlockNonce
EncodeNonce converts the given integer to a block nonce.
func (BlockNonce) MarshalText ¶
func (n BlockNonce) MarshalText() ([]byte, error)
MarshalText encodes n as a hex string with 0x prefix.
func (BlockNonce) Uint64 ¶
func (n BlockNonce) Uint64() uint64
Uint64 returns the integer value of a block nonce.
func (*BlockNonce) UnmarshalText ¶
func (n *BlockNonce) UnmarshalText(input []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type DelAccMsg ¶ added in v1.1.5
type DelAccMsg struct {
// contains filtered or unexported fields
}
func NewDelAccMsg ¶ added in v1.1.5
type LazyValueMarshaler ¶ added in v1.1.8
type LazyValueMarshaler interface {
GetValue() string
}
type MsgAccount ¶ added in v0.18.7
type MsgAccount struct {
// contains filtered or unexported fields
}
func NewMsgAccount ¶ added in v0.18.7
func NewMsgAccount(acc auth.Account) *MsgAccount
func (*MsgAccount) GetKey ¶ added in v0.18.7
func (msgAccount *MsgAccount) GetKey() []byte
func (*MsgAccount) GetType ¶ added in v0.18.8
func (msgAccount *MsgAccount) GetType() uint32
type MsgBlock ¶
type MsgBlock struct {
// contains filtered or unexported fields
}
func NewMsgBlock ¶
type MsgBlockInfo ¶
type MsgBlockInfo struct {
// contains filtered or unexported fields
}
func NewMsgBlockInfo ¶
func NewMsgBlockInfo(height uint64, blockHash common.Hash) *MsgBlockInfo
func (MsgBlockInfo) GetKey ¶
func (b MsgBlockInfo) GetKey() []byte
func (MsgBlockInfo) GetType ¶ added in v0.18.8
func (b MsgBlockInfo) GetType() uint32
func (MsgBlockInfo) GetValue ¶
func (b MsgBlockInfo) GetValue() string
type MsgCodeByHash ¶ added in v0.18.7
func NewMsgCodeByHash ¶ added in v0.18.7
func NewMsgCodeByHash(hash []byte, code []byte) *MsgCodeByHash
func (MsgCodeByHash) GetKey ¶ added in v0.18.7
func (m MsgCodeByHash) GetKey() []byte
func (MsgCodeByHash) GetType ¶ added in v0.18.8
func (m MsgCodeByHash) GetType() uint32
func (MsgCodeByHash) GetValue ¶ added in v0.18.7
func (m MsgCodeByHash) GetValue() string
type MsgContractBlockedListItem ¶ added in v0.18.7
type MsgContractBlockedListItem struct {
// contains filtered or unexported fields
}
func NewMsgContractBlockedListItem ¶ added in v0.18.7
func NewMsgContractBlockedListItem(addr sdk.AccAddress) *MsgContractBlockedListItem
func (*MsgContractBlockedListItem) GetKey ¶ added in v0.18.7
func (msgItem *MsgContractBlockedListItem) GetKey() []byte
func (*MsgContractBlockedListItem) GetType ¶ added in v0.18.8
func (msgItem *MsgContractBlockedListItem) GetType() uint32
func (*MsgContractBlockedListItem) GetValue ¶ added in v0.18.7
func (msgItem *MsgContractBlockedListItem) GetValue() string
type MsgContractDeploymentWhitelistItem ¶ added in v0.18.7
type MsgContractDeploymentWhitelistItem struct {
// contains filtered or unexported fields
}
func NewMsgContractDeploymentWhitelistItem ¶ added in v0.18.7
func NewMsgContractDeploymentWhitelistItem(addr sdk.AccAddress) *MsgContractDeploymentWhitelistItem
func (*MsgContractDeploymentWhitelistItem) GetKey ¶ added in v0.18.7
func (msgItem *MsgContractDeploymentWhitelistItem) GetKey() []byte
func (*MsgContractDeploymentWhitelistItem) GetType ¶ added in v0.18.8
func (msgItem *MsgContractDeploymentWhitelistItem) GetType() uint32
func (*MsgContractDeploymentWhitelistItem) GetValue ¶ added in v0.18.7
func (msgItem *MsgContractDeploymentWhitelistItem) GetValue() string
type MsgContractMethodBlockedListItem ¶ added in v1.0.0
type MsgContractMethodBlockedListItem struct {
// contains filtered or unexported fields
}
func NewMsgContractMethodBlockedListItem ¶ added in v1.0.0
func NewMsgContractMethodBlockedListItem(addr sdk.AccAddress, methods []byte) *MsgContractMethodBlockedListItem
func (*MsgContractMethodBlockedListItem) GetKey ¶ added in v1.0.0
func (msgItem *MsgContractMethodBlockedListItem) GetKey() []byte
func (*MsgContractMethodBlockedListItem) GetType ¶ added in v1.0.0
func (msgItem *MsgContractMethodBlockedListItem) GetType() uint32
func (*MsgContractMethodBlockedListItem) GetValue ¶ added in v1.0.0
func (msgItem *MsgContractMethodBlockedListItem) GetValue() string
type MsgEthTx ¶
type MsgEthTx struct { Key []byte // contains filtered or unexported fields }
func NewMsgEthTx ¶
type MsgLatestHeight ¶
type MsgLatestHeight struct {
// contains filtered or unexported fields
}
func NewMsgLatestHeight ¶
func NewMsgLatestHeight(height uint64) *MsgLatestHeight
func (MsgLatestHeight) GetKey ¶
func (b MsgLatestHeight) GetKey() []byte
func (MsgLatestHeight) GetType ¶ added in v0.18.8
func (b MsgLatestHeight) GetType() uint32
func (MsgLatestHeight) GetValue ¶
func (b MsgLatestHeight) GetValue() string
type MsgParams ¶ added in v0.18.7
func NewMsgParams ¶ added in v0.18.7
type MsgState ¶ added in v0.18.7
type MsgState struct {
// contains filtered or unexported fields
}
func NewMsgState ¶ added in v0.18.7
type MsgTransactionReceipt ¶
type MsgTransactionReceipt struct {
// contains filtered or unexported fields
}
func NewMsgTransactionReceipt ¶
func NewMsgTransactionReceipt(status uint32, tx *types.MsgEthereumTx, txHash, blockHash common.Hash, txIndex, height uint64, data *types.ResultData, cumulativeGas, GasUsed uint64) *MsgTransactionReceipt
func (MsgTransactionReceipt) GetKey ¶
func (m MsgTransactionReceipt) GetKey() []byte
func (MsgTransactionReceipt) GetType ¶ added in v0.18.8
func (m MsgTransactionReceipt) GetType() uint32
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
func NewQuerier ¶
func NewQuerier() *Querier
func (Querier) DeleteAccountFromRdb ¶ added in v0.18.8
func (q Querier) DeleteAccountFromRdb(addr sdk.AccAddress)
func (Querier) DeleteStateFromRdb ¶ added in v0.18.8
func (Querier) GetAccount ¶ added in v0.18.7
func (q Querier) GetAccount(addr sdk.AccAddress) (*types.EthAccount, error)
func (Querier) GetAccountFromRdb ¶ added in v0.18.7
func (q Querier) GetAccountFromRdb(addr sdk.AccAddress) (*types.EthAccount, error)
func (Querier) GetBlockByHash ¶
func (Querier) GetBlockByNumber ¶
func (Querier) GetBlockHashByNumber ¶ added in v0.18.8
func (Querier) GetCodeByHash ¶ added in v0.18.7
func (Querier) GetContractMethodBlockedList ¶ added in v1.0.0
func (Querier) GetLatestBlockNumber ¶
func (Querier) GetStateFromRdb ¶ added in v0.18.7
func (Querier) GetTransactionByBlockHashAndIndex ¶
func (Querier) GetTransactionByBlockNumberAndIndex ¶
func (q Querier) GetTransactionByBlockNumberAndIndex(number uint64, idx uint) (*Transaction, error)
func (Querier) GetTransactionByHash ¶
func (q Querier) GetTransactionByHash(hash common.Hash) (*Transaction, error)
func (Querier) GetTransactionReceipt ¶
func (q Querier) GetTransactionReceipt(hash common.Hash) (*TransactionReceipt, error)
func (Querier) GetTransactionsByBlockNumber ¶ added in v0.19.14
func (q Querier) GetTransactionsByBlockNumber(number, offset, limit uint64) ([]*Transaction, error)
func (Querier) HasContractBlockedList ¶ added in v0.18.7
func (Querier) HasContractDeploymentWhitelist ¶ added in v0.18.7
func (Querier) MustGetAccount ¶ added in v0.18.7
func (q Querier) MustGetAccount(addr sdk.AccAddress) (*types.EthAccount, error)
type Transaction ¶ added in v1.2.0
type Transaction struct { BlockHash *common.Hash `json:"blockHash"` BlockNumber *hexutil.Big `json:"blockNumber"` From common.Address `json:"from"` Gas hexutil.Uint64 `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` Hash common.Hash `json:"hash"` Input hexutil.Bytes `json:"input"` Nonce hexutil.Uint64 `json:"nonce"` To *common.Address `json:"to"` TransactionIndex *hexutil.Uint64 `json:"transactionIndex"` Value *hexutil.Big `json:"value"` V *hexutil.Big `json:"v"` R *hexutil.Big `json:"r"` S *hexutil.Big `json:"s"` }
Transaction represents a transaction returned to RPC clients.
func NewTransaction ¶ added in v1.2.0
func NewTransaction(tx *evmtypes.MsgEthereumTx, txHash, blockHash common.Hash, blockNumber, index uint64) (*Transaction, error)
NewTransaction returns a transaction that will serialize to the RPC representation, with the given location metadata set (if available).
type TransactionReceipt ¶
type TransactionReceipt struct { Status hexutil.Uint64 `json:"status"` CumulativeGasUsed hexutil.Uint64 `json:"cumulativeGasUsed"` LogsBloom ethtypes.Bloom `json:"logsBloom"` Logs []*ethtypes.Log `json:"logs"` TransactionHash string `json:"transactionHash"` ContractAddress *common.Address `json:"contractAddress"` GasUsed hexutil.Uint64 `json:"gasUsed"` BlockHash string `json:"blockHash"` BlockNumber hexutil.Uint64 `json:"blockNumber"` TransactionIndex hexutil.Uint64 `json:"transactionIndex"` From string `json:"from"` To *common.Address `json:"to"` }
type WatchData ¶ added in v1.0.0
type WatchData struct { DirtyAccount []*sdk.AccAddress `json:"dirty_account"` Batches []*Batch `json:"batches"` DelayEraseKey [][]byte `json:"delay_erase_key"` BloomData []*types.KV `json:"bloom_data"` DirtyList [][]byte `json:"dirty_list"` }
func (*WatchData) MarshalToAmino ¶ added in v1.1.6
MarshalToAmino marshal to amino bytes
func (*WatchData) UnmarshalFromAmino ¶ added in v1.1.6
UnmarshalFromAmino unmarshal from amino bytes
type WatchMessage ¶
type WatchStore ¶
type WatchStore struct {
// contains filtered or unexported fields
}
func InstanceOfWatchStore ¶
func InstanceOfWatchStore() *WatchStore
func (WatchStore) Delete ¶ added in v0.18.7
func (w WatchStore) Delete(key []byte)
func (WatchStore) GetUnsafe ¶ added in v1.2.0
func (w WatchStore) GetUnsafe(key []byte, processor dbm.UnsafeValueProcessor) (interface{}, error)
func (WatchStore) Has ¶ added in v0.18.7
func (w WatchStore) Has(key []byte) bool
func (WatchStore) Iterator ¶ added in v1.1.0
func (w WatchStore) Iterator(start, end []byte) dbm.Iterator
func (WatchStore) Set ¶
func (w WatchStore) Set(key []byte, value []byte)
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func (*Watcher) AddDelAccMsg ¶ added in v1.1.5
func (*Watcher) CheckWatchDB ¶ added in v1.1.1
func (*Watcher) CommitAccountToRpcDb ¶ added in v0.18.7
func (*Watcher) CommitCodeHashToDb ¶ added in v0.18.7
func (*Watcher) CommitStateToRpcDb ¶ added in v0.18.7
func (*Watcher) CommitWatchData ¶ added in v1.0.0
func (*Watcher) DeleteAccount ¶ added in v0.18.7
func (w *Watcher) DeleteAccount(addr sdk.AccAddress)
func (*Watcher) DeleteContractBlockedList ¶ added in v0.18.7
func (w *Watcher) DeleteContractBlockedList(addr sdk.AccAddress)
func (*Watcher) DeleteContractDeploymentWhitelist ¶ added in v0.18.7
func (w *Watcher) DeleteContractDeploymentWhitelist(addr sdk.AccAddress)
func (*Watcher) ExecuteDelayEraseKey ¶ added in v0.18.9
func (*Watcher) GetBloomDataPoint ¶ added in v1.0.0
func (*Watcher) GetWatchDataFunc ¶ added in v1.1.6
func (*Watcher) IsFirstUse ¶ added in v0.18.7
func (*Watcher) SaveAccount ¶ added in v0.18.7
func (*Watcher) SaveContractBlockedListItem ¶ added in v0.18.7
func (w *Watcher) SaveContractBlockedListItem(addr sdk.AccAddress)
func (*Watcher) SaveContractCode ¶
func (*Watcher) SaveContractCodeByHash ¶ added in v0.18.7
func (*Watcher) SaveContractDeploymentWhitelistItem ¶ added in v0.18.7
func (w *Watcher) SaveContractDeploymentWhitelistItem(addr sdk.AccAddress)
func (*Watcher) SaveContractMethodBlockedListItem ¶ added in v1.0.0
func (w *Watcher) SaveContractMethodBlockedListItem(addr sdk.AccAddress, methods []byte)
func (*Watcher) SaveEthereumTx ¶
func (*Watcher) SaveLatestHeight ¶
func (*Watcher) SaveParams ¶ added in v0.18.7
func (*Watcher) SaveTransactionReceipt ¶
func (w *Watcher) SaveTransactionReceipt(status uint32, msg *evmtypes.MsgEthereumTx, txHash common.Hash, txIndex uint64, data *evmtypes.ResultData, gasUsed uint64)
func (*Watcher) SetWatchDataFunc ¶ added in v1.0.0
func (w *Watcher) SetWatchDataFunc()
func (*Watcher) UnmarshalWatchData ¶ added in v1.1.6
func (*Watcher) UpdateBlockTxs ¶
func (*Watcher) UpdateCumulativeGas ¶
func (*Watcher) UseWatchData ¶ added in v1.1.0
func (w *Watcher) UseWatchData(watchData interface{})