Documentation
¶
Index ¶
- Constants
- func APIList(ctx context.Context, db ethdb.RoKV, eth services.ApiBackend, ...) []rpc.API
- func HeaderByNumberOrHash(ctx context.Context, tx ethdb.Tx, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)
- type APIImpl
- func (api *APIImpl) Accounts(ctx context.Context) ([]common.Address, error)
- func (api *APIImpl) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
- func (api *APIImpl) BlockNumber(ctx context.Context) (hexutil.Uint64, error)
- func (api *APIImpl) Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, ...) (hexutil.Bytes, error)
- func (api *APIImpl) CallBundle(ctx context.Context, txHashes []common.Hash, ...) (map[string]interface{}, error)
- func (api *APIImpl) ChainConfig() *params.ChainConfig
- func (api *APIImpl) ChainId(ctx context.Context) (hexutil.Uint64, error)
- func (api *APIImpl) Coinbase(ctx context.Context) (common.Address, error)
- func (api *APIImpl) CompileLLL(_ context.Context, _ string) (hexutil.Bytes, error)
- func (api *APIImpl) CompileSerpent(ctx context.Context, _ string) (hexutil.Bytes, error)
- func (api *APIImpl) CompileSolidity(ctx context.Context, _ string) (hexutil.Bytes, error)
- func (api *APIImpl) EstimateGas(ctx context.Context, args ethapi.CallArgs, ...) (hexutil.Uint64, error)
- func (api *APIImpl) GasPrice(ctx context.Context) (*hexutil.Big, error)
- func (api *APIImpl) GetBalance(ctx context.Context, address common.Address, ...) (*hexutil.Big, error)
- func (api *APIImpl) GetBlockByHash(ctx context.Context, numberOrHash rpc.BlockNumberOrHash, fullTx bool) (map[string]interface{}, error)
- func (api *APIImpl) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
- func (api *APIImpl) GetBlockReceipts(ctx context.Context, number rpc.BlockNumber) ([]map[string]interface{}, error)
- func (api *APIImpl) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (*hexutil.Uint, error)
- func (api *APIImpl) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*hexutil.Uint, error)
- func (api *APIImpl) GetCode(ctx context.Context, address common.Address, ...) (hexutil.Bytes, error)
- func (api *APIImpl) GetCompilers(_ context.Context) ([]string, error)
- func (api *APIImpl) GetFilterChanges(_ context.Context, index hexutil.Uint64) ([]interface{}, error)
- func (api *APIImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error)
- func (api *APIImpl) GetProof(ctx context.Context, address common.Address, storageKeys []string, ...) (*interface{}, error)
- func (api *APIImpl) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (hexutil.Bytes, error)
- func (api *APIImpl) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (hexutil.Bytes, error)
- func (api *APIImpl) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)
- func (api *APIImpl) GetStorageAt(ctx context.Context, address common.Address, index string, ...) (string, error)
- func (api *APIImpl) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, txIndex hexutil.Uint64) (*RPCTransaction, error)
- func (api *APIImpl) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, txIndex hexutil.Uint) (*RPCTransaction, error)
- func (api *APIImpl) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error)
- func (api *APIImpl) GetTransactionCount(ctx context.Context, address common.Address, ...) (*hexutil.Uint64, error)
- func (api *APIImpl) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
- func (api *APIImpl) GetUncleByBlockHashAndIndex(ctx context.Context, hash common.Hash, index hexutil.Uint) (map[string]interface{}, error)
- func (api *APIImpl) GetUncleByBlockNumberAndIndex(ctx context.Context, number rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)
- func (api *APIImpl) GetUncleCountByBlockHash(ctx context.Context, hash common.Hash) (*hexutil.Uint, error)
- func (api *APIImpl) GetUncleCountByBlockNumber(ctx context.Context, number rpc.BlockNumber) (*hexutil.Uint, error)
- func (api *APIImpl) GetWork(ctx context.Context) ([4]string, error)
- func (api *APIImpl) Hashrate(ctx context.Context) (uint64, error)
- func (api *APIImpl) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)
- func (api *APIImpl) Mining(ctx context.Context) (bool, error)
- func (api *APIImpl) NewBlockFilter(_ context.Context) (hexutil.Uint64, error)
- func (api *APIImpl) NewFilter(_ context.Context, filter interface{}) (hexutil.Uint64, error)
- func (api *APIImpl) NewHeads(ctx context.Context) (*rpc.Subscription, error)
- func (api *APIImpl) NewPendingTransactionFilter(ctx context.Context) (hexutil.Uint64, error)
- func (api *APIImpl) NewPendingTransactions(ctx context.Context) (*rpc.Subscription, error)
- func (api *APIImpl) ProtocolVersion(ctx context.Context) (hexutil.Uint, error)
- func (api *APIImpl) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
- func (api *APIImpl) SendTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
- func (api *APIImpl) Sign(ctx context.Context, _ common.Address, _ hexutil.Bytes) (hexutil.Bytes, error)
- func (api *APIImpl) SignTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
- func (api *APIImpl) SubmitHashrate(ctx context.Context, hashRate hexutil.Uint64, id common.Hash) (bool, error)
- func (api *APIImpl) SubmitWork(ctx context.Context, nonce types.BlockNonce, powHash, digest common.Hash) (bool, error)
- func (api *APIImpl) Syncing(ctx context.Context) (interface{}, error)
- func (api *APIImpl) UninstallFilter(_ context.Context, index hexutil.Uint64) (bool, error)
- type AccountResult
- type BaseAPI
- type CallTraceAction
- type CreateTraceAction
- type CreateTraceResult
- type DBAPI
- type DBAPIImpl
- func (api *DBAPIImpl) GetHex(_ context.Context, _ string, _ string) (hexutil.Bytes, error)
- func (api *DBAPIImpl) GetString(_ context.Context, _ string, _ string) (string, error)
- func (api *DBAPIImpl) PutHex(_ context.Context, _ string, _ string, _ hexutil.Bytes) (bool, error)
- func (api *DBAPIImpl) PutString(_ context.Context, _ string, _ string, _ string) (bool, error)
- type ErigonAPI
- type ErigonImpl
- func (api *ErigonImpl) Forks(ctx context.Context) (Forks, error)
- func (api *ErigonImpl) GetHeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (api *ErigonImpl) GetHeaderByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Header, error)
- func (api *ErigonImpl) GetLogsByHash(ctx context.Context, hash common.Hash) ([][]*types.Log, error)
- func (api *ErigonImpl) Issuance(ctx context.Context, blockNr rpc.BlockNumber) (Issuance, error)
- type EthAPI
- type Forks
- type GethTrace
- type GethTraces
- type Issuance
- type NetAPI
- type NetAPIImpl
- type OeTracer
- func (ot *OeTracer) CaptureAccountRead(account common.Address) error
- func (ot *OeTracer) CaptureAccountWrite(account common.Address) error
- func (ot *OeTracer) CaptureEnd(depth int, output []byte, gasUsed uint64, t time.Duration, err error) error
- func (ot *OeTracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (ot *OeTracer) CaptureSelfDestruct(from common.Address, to common.Address, value *big.Int)
- func (ot *OeTracer) CaptureStart(depth int, from common.Address, to common.Address, precompile bool, ...) error
- func (ot *OeTracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- type ParityTrace
- type ParityTraces
- type PrivateDebugAPI
- type PrivateDebugAPIImpl
- func (api *PrivateDebugAPIImpl) AccountAt(ctx context.Context, blockHash common.Hash, txIndex uint64, ...) (*AccountResult, error)
- func (api *PrivateDebugAPIImpl) AccountRange(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, startKey []byte, ...) (state.IteratorDump, error)
- func (api *PrivateDebugAPIImpl) GetModifiedAccountsByHash(ctx context.Context, startHash common.Hash, endHash *common.Hash) ([]common.Address, error)
- func (api *PrivateDebugAPIImpl) GetModifiedAccountsByNumber(ctx context.Context, startNumber rpc.BlockNumber, endNumber *rpc.BlockNumber) ([]common.Address, error)
- func (api *PrivateDebugAPIImpl) StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex uint64, ...) (StorageRangeResult, error)
- func (api *PrivateDebugAPIImpl) TraceCall(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, ...) error
- func (api *PrivateDebugAPIImpl) TraceTransaction(ctx context.Context, hash common.Hash, config *tracers.TraceConfig, ...) error
- type RPCTransaction
- type RewardTraceAction
- type SHHAPI
- type SHHAPIImpl
- func (api *SHHAPIImpl) AddToGroup(_ context.Context, _ string) (bool, error)
- func (api *SHHAPIImpl) GetFilterChanges(_ context.Context, _ hexutil.Uint) ([]string, error)
- func (api *SHHAPIImpl) GetMessages(_ context.Context, _ hexutil.Uint) ([]string, error)
- func (api *SHHAPIImpl) HasIdentity(_ context.Context, _ string) (bool, error)
- func (api *SHHAPIImpl) NewFilter(_ context.Context, _ SHHFilter) (hexutil.Uint, error)
- func (api *SHHAPIImpl) NewGroup(_ context.Context) (string, error)
- func (api *SHHAPIImpl) NewIdentity(_ context.Context) (string, error)
- func (api *SHHAPIImpl) Post(_ context.Context, _ SHHPost) (bool, error)
- func (api *SHHAPIImpl) UninstallFilter(_ context.Context, _ hexutil.Uint) (bool, error)
- func (api *SHHAPIImpl) Version(_ context.Context) (string, error)
- type SHHFilter
- type SHHPost
- type StateDiff
- func (sd *StateDiff) CompareStates(initialIbs, ibs *state.IntraBlockState)
- func (sd *StateDiff) CreateContract(address common.Address) error
- func (sd *StateDiff) DeleteAccount(ctx context.Context, address common.Address, original *accounts.Account) error
- func (sd *StateDiff) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (sd *StateDiff) UpdateAccountData(ctx context.Context, address common.Address, ...) error
- func (sd *StateDiff) WriteAccountStorage(ctx context.Context, address common.Address, incarnation uint64, ...) error
- type StateDiffAccount
- type StateDiffBalance
- type StateDiffCode
- type StateDiffNonce
- type StateDiffStorage
- type StorageEntry
- type StorageMap
- type StorageRangeResult
- type SuicideTraceAction
- type TraceAPI
- type TraceAPIImpl
- func (api *TraceAPIImpl) Block(ctx context.Context, blockNr rpc.BlockNumber) (ParityTraces, error)
- func (api *TraceAPIImpl) Call(ctx context.Context, args TraceCallParam, traceTypes []string, ...) (*TraceCallResult, error)
- func (api *TraceAPIImpl) CallMany(ctx context.Context, calls json.RawMessage, ...) ([]*TraceCallResult, error)
- func (api *TraceAPIImpl) Filter(ctx context.Context, req TraceFilterRequest, stream *jsoniter.Stream) error
- func (api *TraceAPIImpl) Get(ctx context.Context, txHash common.Hash, indicies []hexutil.Uint64) (*ParityTrace, error)
- func (api *TraceAPIImpl) RawTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
- func (api *TraceAPIImpl) ReplayBlockTransactions(ctx context.Context, blockNr rpc.BlockNumber, traceTypes []string) ([]interface{}, error)
- func (api *TraceAPIImpl) ReplayTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
- func (api *TraceAPIImpl) Transaction(ctx context.Context, txHash common.Hash) (ParityTraces, error)
- type TraceAction
- type TraceCallParam
- type TraceCallResult
- type TraceCallVmTrace
- type TraceFilterRequest
- type TraceResult
- type Web3API
- type Web3APIImpl
Constants ¶
const ( CALL = "call" CALLCODE = "callcode" DELEGATECALL = "delegatecall" STATICCALL = "staticcall" CREATE = "create" SUICIDE = "suicide" REWARD = "reward" TraceTypeTrace = "trace" TraceTypeStateDiff = "stateDiff" TraceTypeVmTrace = "vmTrace" )
const NotAvailableChainData = "the function %s is not available, please use --private.api.addr option instead of --datadir option"
NotAvailableChainData x
const NotAvailableDeprecated = "the method has been deprecated: %s"
NotAvailableDeprecated x
const NotImplemented = "the method is currently not implemented: %s"
NotImplemented is the URI prefix for smartcard wallets.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIImpl ¶
APIImpl is implementation of the EthAPI interface based on remote Db access
func NewEthAPI ¶
func NewEthAPI(base *BaseAPI, db ethdb.RoKV, eth services.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient, gascap uint64) *APIImpl
NewEthAPI returns APIImpl instance
func (*APIImpl) Accounts ¶
Accounts implements eth_accounts. Returns a list of addresses owned by the client. Deprecated: This function will be removed in the future.
func (*APIImpl) BlockByNumber ¶
func (api *APIImpl) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
BlockByNumber is necessary for gasprice.OracleBackend implementation
func (*APIImpl) BlockNumber ¶
BlockNumber implements eth_blockNumber. Returns the block number of most recent block.
func (*APIImpl) Call ¶
func (api *APIImpl) Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *map[common.Address]ethapi.Account) (hexutil.Bytes, error)
Call implements eth_call. Executes a new message call immediately without creating a transaction on the block chain.
func (*APIImpl) CallBundle ¶
func (*APIImpl) ChainConfig ¶
func (api *APIImpl) ChainConfig() *params.ChainConfig
ChainConfig is necessary for gasprice.OracleBackend implementation
func (*APIImpl) Coinbase ¶
Coinbase implements eth_coinbase. Returns the current client coinbase address.
func (*APIImpl) CompileLLL ¶
CompileLLL implements eth_compileLLL. Returns compiled LLL code. Deprecated: This function will be removed in the future.
func (*APIImpl) CompileSerpent ¶
CompileSerpent implements eth_compileSerpent. Returns compiled serpent code. Deprecated: This function will be removed in the future.
func (*APIImpl) CompileSolidity ¶
CompileSolidity implements eth_compileSolidity. Returns compiled solidity code. Deprecated: This function will be removed in the future.
func (*APIImpl) EstimateGas ¶
func (api *APIImpl) EstimateGas(ctx context.Context, args ethapi.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error)
EstimateGas implements eth_estimateGas. Returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.
func (*APIImpl) GasPrice ¶
GasPrice implements eth_gasPrice. Returns the current price per gas in wei.
func (*APIImpl) GetBalance ¶
func (api *APIImpl) GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)
GetBalance implements eth_getBalance. Returns the balance of an account for a given address.
func (*APIImpl) GetBlockByHash ¶
func (api *APIImpl) GetBlockByHash(ctx context.Context, numberOrHash rpc.BlockNumberOrHash, fullTx bool) (map[string]interface{}, error)
GetBlockByHash implements eth_getBlockByHash. Returns information about a block given the block's hash.
func (*APIImpl) GetBlockByNumber ¶
func (api *APIImpl) GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
GetBlockByNumber implements eth_getBlockByNumber. Returns information about a block given the block's number.
func (*APIImpl) GetBlockReceipts ¶
func (api *APIImpl) GetBlockReceipts(ctx context.Context, number rpc.BlockNumber) ([]map[string]interface{}, error)
GetBlockReceipts - receipts for individual block
func (*APIImpl) GetBlockTransactionCountByHash ¶
func (api *APIImpl) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (*hexutil.Uint, error)
GetBlockTransactionCountByHash implements eth_getBlockTransactionCountByHash. Returns the number of transactions in a block given the block's block hash.
func (*APIImpl) GetBlockTransactionCountByNumber ¶
func (api *APIImpl) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*hexutil.Uint, error)
GetBlockTransactionCountByNumber implements eth_getBlockTransactionCountByNumber. Returns the number of transactions in a block given the block's block number.
func (*APIImpl) GetCode ¶
func (api *APIImpl) GetCode(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
GetCode implements eth_getCode. Returns the byte code at a given address (if it's a smart contract).
func (*APIImpl) GetCompilers ¶
GetCompilers implements eth_getCompilers. Returns a list of available compilers in the client. Deprecated: This function will be removed in the future.
func (*APIImpl) GetFilterChanges ¶
func (api *APIImpl) GetFilterChanges(_ context.Context, index hexutil.Uint64) ([]interface{}, error)
GetFilterChanges implements eth_getFilterChanges. Polling method for a previously-created filter, which returns an array of logs which occurred since last poll.
func (*APIImpl) GetLogs ¶
GetLogs implements eth_getLogs. Returns an array of logs matching a given filter object.
func (*APIImpl) GetProof ¶
func (api *APIImpl) GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNr rpc.BlockNumber) (*interface{}, error)
GetProof not implemented
func (*APIImpl) GetRawTransactionByBlockHashAndIndex ¶
func (api *APIImpl) GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (hexutil.Bytes, error)
GetRawTransactionByBlockHashAndIndex returns the bytes of the transaction for the given block hash and index.
func (*APIImpl) GetRawTransactionByBlockNumberAndIndex ¶
func (api *APIImpl) GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (hexutil.Bytes, error)
GetRawTransactionByBlockNumberAndIndex returns the bytes of the transaction for the given block number and index.
func (*APIImpl) GetRawTransactionByHash ¶
func (api *APIImpl) GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)
GetRawTransactionByHash returns the bytes of the transaction for the given hash.
func (*APIImpl) GetStorageAt ¶
func (api *APIImpl) GetStorageAt(ctx context.Context, address common.Address, index string, blockNrOrHash rpc.BlockNumberOrHash) (string, error)
GetStorageAt implements eth_getStorageAt. Returns the value from a storage position at a given address.
func (*APIImpl) GetTransactionByBlockHashAndIndex ¶
func (api *APIImpl) GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, txIndex hexutil.Uint64) (*RPCTransaction, error)
GetTransactionByBlockHashAndIndex implements eth_getTransactionByBlockHashAndIndex. Returns information about a transaction given the block's hash and a transaction index.
func (*APIImpl) GetTransactionByBlockNumberAndIndex ¶
func (api *APIImpl) GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, txIndex hexutil.Uint) (*RPCTransaction, error)
GetTransactionByBlockNumberAndIndex implements eth_getTransactionByBlockNumberAndIndex. Returns information about a transaction given a block number and transaction index.
func (*APIImpl) GetTransactionByHash ¶
func (api *APIImpl) GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error)
GetTransactionByHash implements eth_getTransactionByHash. Returns information about a transaction given the transaction's hash.
func (*APIImpl) GetTransactionCount ¶
func (api *APIImpl) GetTransactionCount(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error)
GetTransactionCount implements eth_getTransactionCount. Returns the number of transactions sent from an address (the nonce).
func (*APIImpl) GetTransactionReceipt ¶
func (api *APIImpl) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
GetTransactionReceipt implements eth_getTransactionReceipt. Returns the receipt of a transaction given the transaction's hash.
func (*APIImpl) GetUncleByBlockHashAndIndex ¶
func (api *APIImpl) GetUncleByBlockHashAndIndex(ctx context.Context, hash common.Hash, index hexutil.Uint) (map[string]interface{}, error)
GetUncleByBlockHashAndIndex implements eth_getUncleByBlockHashAndIndex. Returns information about an uncle given a block's hash and the index of the uncle.
func (*APIImpl) GetUncleByBlockNumberAndIndex ¶
func (api *APIImpl) GetUncleByBlockNumberAndIndex(ctx context.Context, number rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)
GetUncleByBlockNumberAndIndex implements eth_getUncleByBlockNumberAndIndex. Returns information about an uncle given a block's number and the index of the uncle.
func (*APIImpl) GetUncleCountByBlockHash ¶
func (api *APIImpl) GetUncleCountByBlockHash(ctx context.Context, hash common.Hash) (*hexutil.Uint, error)
GetUncleCountByBlockHash implements eth_getUncleCountByBlockHash. Returns the number of uncles in the block, if any.
func (*APIImpl) GetUncleCountByBlockNumber ¶
func (api *APIImpl) GetUncleCountByBlockNumber(ctx context.Context, number rpc.BlockNumber) (*hexutil.Uint, error)
GetUncleCountByBlockNumber implements eth_getUncleCountByBlockNumber. Returns the number of uncles in the block, if any.
func (*APIImpl) GetWork ¶
GetWork returns a work package for external miner.
The work package consists of 3 strings:
result[0] - 32 bytes hex encoded current block header pow-hash
result[1] - 32 bytes hex encoded seed hash used for DAG
result[2] - 32 bytes hex encoded boundary condition ("target"), 2^256/difficulty
result[3] - hex encoded block number
func (*APIImpl) Hashrate ¶
Hashrate implements eth_hashrate. Returns the number of hashes per second that the node is mining with.
func (*APIImpl) HeaderByNumber ¶
func (api *APIImpl) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)
HeaderByNumber is necessary for gasprice.OracleBackend implementation
func (*APIImpl) NewBlockFilter ¶
NewBlockFilter new transaction filter
func (*APIImpl) NewFilter ¶
NewFilter implements eth_newFilter. Creates an arbitrary filter object, based on filter options, to notify when the state changes (logs).
func (*APIImpl) NewHeads ¶
NewHeads send a notification each time a new (header) block is appended to the chain.
func (*APIImpl) NewPendingTransactionFilter ¶
NewPendingTransactionFilter new transaction filter
func (*APIImpl) NewPendingTransactions ¶
NewPendingTransactions send a notification each time a new (header) block is appended to the chain.
func (*APIImpl) ProtocolVersion ¶
ProtocolVersion implements eth_protocolVersion. Returns the current ethereum protocol version.
func (*APIImpl) SendRawTransaction ¶
func (api *APIImpl) SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
SendRawTransaction implements eth_sendRawTransaction. Creates new message call transaction or a contract creation for previously-signed transactions.
func (*APIImpl) SendTransaction ¶
SendTransaction implements eth_sendTransaction. Creates new message call transaction or a contract creation if the data field contains code.
func (*APIImpl) Sign ¶
func (api *APIImpl) Sign(ctx context.Context, _ common.Address, _ hexutil.Bytes) (hexutil.Bytes, error)
Sign implements eth_sign. Calculates an Ethereum specific signature with: sign(keccak256('\\x19Ethereum Signed Message:\\n' + len(message) + message))). Deprecated: This function will be removed in the future.
func (*APIImpl) SignTransaction ¶
SignTransaction deprecated
func (*APIImpl) SubmitHashrate ¶
func (api *APIImpl) SubmitHashrate(ctx context.Context, hashRate hexutil.Uint64, id common.Hash) (bool, error)
SubmitHashrate can be used for remote miners to submit their hash rate. This enables the node to report the combined hash rate of all miners which submit work through this node.
It accepts the miner hash rate and an identifier which must be unique
func (*APIImpl) SubmitWork ¶
func (api *APIImpl) SubmitWork(ctx context.Context, nonce types.BlockNonce, powHash, digest common.Hash) (bool, error)
SubmitWork can be used by external miner to submit their POW solution. It returns an indication if the work was accepted. Note either an invalid solution, a stale work a non-existent work will return false.
type AccountResult ¶
type CallTraceAction ¶
type CreateTraceAction ¶
type CreateTraceResult ¶
type DBAPI ¶
type DBAPI interface {
GetString(_ context.Context, _ string, _ string) (string, error)
PutString(_ context.Context, _ string, _ string, _ string) (bool, error)
GetHex(_ context.Context, _ string, _ string) (hexutil.Bytes, error)
PutHex(_ context.Context, _ string, _ string, _ hexutil.Bytes) (bool, error)
}
DBAPI the interface for the db_ RPC commands (deprecated)
type DBAPIImpl ¶
type DBAPIImpl struct {
// contains filtered or unexported fields
}
DBAPIImpl data structure to store things needed for db_ commands
func (*DBAPIImpl) GetHex ¶
GetHex implements db_getHex. Returns binary data from the local database. Deprecated: This function will be removed in the future.
func (*DBAPIImpl) GetString ¶
GetString implements db_getString. Returns string from the local database. Deprecated: This function will be removed in the future.
type ErigonAPI ¶
type ErigonAPI interface {
// System related (see ./erigon_system.go)
Forks(ctx context.Context) (Forks, error)
// Blocks related (see ./erigon_blocks.go)
GetHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)
GetHeaderByHash(_ context.Context, hash common.Hash) (*types.Header, error)
// Receipt related (see ./erigon_receipts.go)
GetLogsByHash(ctx context.Context, hash common.Hash) ([][]*types.Log, error)
// Issuance / reward related (see ./erigon_issuance.go)
// BlockReward(ctx context.Context, blockNr rpc.BlockNumber) (Issuance, error)
// UncleReward(ctx context.Context, blockNr rpc.BlockNumber) (Issuance, error)
Issuance(ctx context.Context, blockNr rpc.BlockNumber) (Issuance, error)
}
ErigonAPI Erigon specific routines
type ErigonImpl ¶
type ErigonImpl struct {
*BaseAPI
// contains filtered or unexported fields
}
ErigonImpl is implementation of the ErigonAPI interface
func NewErigonAPI ¶
func NewErigonAPI(base *BaseAPI, db ethdb.RoKV) *ErigonImpl
NewErigonAPI returns ErigonImpl instance
func (*ErigonImpl) Forks ¶
func (api *ErigonImpl) Forks(ctx context.Context) (Forks, error)
Forks implements erigon_forks. Returns the genesis block hash and a sorted list of all forks block numbers
func (*ErigonImpl) GetHeaderByHash ¶
func (api *ErigonImpl) GetHeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
GetHeaderByHash implements erigon_getHeaderByHash. Returns a block's header given a block's hash.
func (*ErigonImpl) GetHeaderByNumber ¶
func (api *ErigonImpl) GetHeaderByNumber(ctx context.Context, blockNumber rpc.BlockNumber) (*types.Header, error)
GetHeaderByNumber implements erigon_getHeaderByNumber. Returns a block's header given a block number ignoring the block's transaction and uncle list (may be faster).
func (*ErigonImpl) GetLogsByHash ¶
GetLogsByHash implements erigon_getLogsByHash. Returns an array of arrays of logs generated by the transactions in the block given by the block's hash.
func (*ErigonImpl) Issuance ¶
func (api *ErigonImpl) Issuance(ctx context.Context, blockNr rpc.BlockNumber) (Issuance, error)
Issuance implements erigon_issuance. Returns the total issuance (block reward plus uncle reward) for the given block.
type EthAPI ¶
type EthAPI interface {
// Block related (proposed file: ./eth_blocks.go)
GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
GetBlockByHash(ctx context.Context, hash rpc.BlockNumberOrHash, fullTx bool) (map[string]interface{}, error)
GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*hexutil.Uint, error)
GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (*hexutil.Uint, error)
// Transaction related (see ./eth_txs.go)
GetTransactionByHash(ctx context.Context, hash common.Hash) (*RPCTransaction, error)
GetTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, txIndex hexutil.Uint64) (*RPCTransaction, error)
GetTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, txIndex hexutil.Uint) (*RPCTransaction, error)
GetRawTransactionByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (hexutil.Bytes, error)
GetRawTransactionByBlockHashAndIndex(ctx context.Context, blockHash common.Hash, index hexutil.Uint) (hexutil.Bytes, error)
GetRawTransactionByHash(ctx context.Context, hash common.Hash) (hexutil.Bytes, error)
// Receipt related (see ./eth_receipts.go)
GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
GetLogs(ctx context.Context, crit ethFilters.FilterCriteria) ([]*types.Log, error)
GetBlockReceipts(ctx context.Context, number rpc.BlockNumber) ([]map[string]interface{}, error)
// Uncle related (see ./eth_uncles.go)
GetUncleByBlockNumberAndIndex(ctx context.Context, blockNr rpc.BlockNumber, index hexutil.Uint) (map[string]interface{}, error)
GetUncleByBlockHashAndIndex(ctx context.Context, hash common.Hash, index hexutil.Uint) (map[string]interface{}, error)
GetUncleCountByBlockNumber(ctx context.Context, number rpc.BlockNumber) (*hexutil.Uint, error)
GetUncleCountByBlockHash(ctx context.Context, hash common.Hash) (*hexutil.Uint, error)
// Filter related (see ./eth_filters.go)
NewPendingTransactionFilter(_ context.Context) (hexutil.Uint64, error)
NewBlockFilter(_ context.Context) (hexutil.Uint64, error)
NewFilter(_ context.Context, filter interface{}) (hexutil.Uint64, error)
UninstallFilter(_ context.Context, index hexutil.Uint64) (bool, error)
GetFilterChanges(_ context.Context, index hexutil.Uint64) ([]interface{}, error)
// Account related (see ./eth_accounts.go)
Accounts(ctx context.Context) ([]common.Address, error)
GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)
GetTransactionCount(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error)
GetStorageAt(ctx context.Context, address common.Address, index string, blockNrOrHash rpc.BlockNumberOrHash) (string, error)
GetCode(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error)
// System related (see ./eth_system.go)
BlockNumber(ctx context.Context) (hexutil.Uint64, error)
Syncing(ctx context.Context) (interface{}, error)
ChainId(ctx context.Context) (hexutil.Uint64, error) /* called eth_protocolVersion elsewhere */
ProtocolVersion(_ context.Context) (hexutil.Uint, error)
GasPrice(_ context.Context) (*hexutil.Big, error)
// Sending related (see ./eth_call.go)
Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *map[common.Address]ethapi.Account) (hexutil.Bytes, error)
EstimateGas(ctx context.Context, args ethapi.CallArgs, blockNrOrHash *rpc.BlockNumberOrHash) (hexutil.Uint64, error)
SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
SendTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
Sign(ctx context.Context, _ common.Address, _ hexutil.Bytes) (hexutil.Bytes, error)
SignTransaction(_ context.Context, txObject interface{}) (common.Hash, error)
GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNr rpc.BlockNumber) (*interface{}, error)
// Mining related (see ./eth_mining.go)
Coinbase(ctx context.Context) (common.Address, error)
Hashrate(ctx context.Context) (uint64, error)
Mining(ctx context.Context) (bool, error)
GetWork(ctx context.Context) ([4]string, error)
SubmitWork(ctx context.Context, nonce types.BlockNonce, powHash, digest common.Hash) (bool, error)
SubmitHashrate(ctx context.Context, hashRate hexutil.Uint64, id common.Hash) (bool, error)
// Deprecated commands in eth_ (proposed file: ./eth_deprecated.go)
GetCompilers(_ context.Context) ([]string, error)
CompileLLL(_ context.Context, _ string) (hexutil.Bytes, error)
CompileSolidity(ctx context.Context, _ string) (hexutil.Bytes, error)
CompileSerpent(ctx context.Context, _ string) (hexutil.Bytes, error)
}
EthAPI is a collection of functions that are exposed in the
type GethTrace ¶
type GethTrace struct {
Type string `json:"type"`
Error string `json:"error"`
From string `json:"from"`
To string `json:"to"`
Value string `json:"value"`
Gas string `json:"gas"`
GasUsed string `json:"gasUsed"`
Input string `json:"input"`
Output string `json:"output"`
Time string `json:"time"`
Calls GethTraces `json:"calls"`
}
GethTrace The trace as received from the existing Geth javascript tracer 'callTracer'
type Issuance ¶
type Issuance struct {
BlockReward string `json:"blockReward,omitempty"`
UncleReward string `json:"uncleReward,omitempty"`
Issuance string `json:"issuance,omitempty"`
}
Issuance structure to return information about issuance
type NetAPI ¶
type NetAPI interface {
Listening(_ context.Context) (bool, error)
Version(_ context.Context) (string, error)
PeerCount(_ context.Context) (hexutil.Uint, error)
}
NetAPI the interface for the net_ RPC commands
type NetAPIImpl ¶
type NetAPIImpl struct {
// contains filtered or unexported fields
}
NetAPIImpl data structure to store things needed for net_ commands
func NewNetAPIImpl ¶
func NewNetAPIImpl(eth services.ApiBackend) *NetAPIImpl
NewNetAPIImpl returns NetAPIImplImpl instance
func (*NetAPIImpl) Listening ¶
func (api *NetAPIImpl) Listening(_ context.Context) (bool, error)
Listening implements net_listening. Returns true if client is actively listening for network connections. TODO: Remove hard coded value
type OeTracer ¶
type OeTracer struct {
// contains filtered or unexported fields
}
OpenEthereum-style tracer
func (*OeTracer) CaptureAccountRead ¶
func (*OeTracer) CaptureAccountWrite ¶
func (*OeTracer) CaptureEnd ¶
func (*OeTracer) CaptureFault ¶
func (*OeTracer) CaptureSelfDestruct ¶
func (*OeTracer) CaptureStart ¶
type ParityTrace ¶
type ParityTrace struct {
// Do not change the ordering of these fields -- allows for easier comparison with other clients
Action interface{} `json:"action"` // Can be either CallTraceAction or CreateTraceAction
BlockHash *common.Hash `json:"blockHash,omitempty"`
BlockNumber *uint64 `json:"blockNumber,omitempty"`
Error string `json:"error,omitempty"`
Result interface{} `json:"result"`
Subtraces int `json:"subtraces"`
TraceAddress []int `json:"traceAddress"`
TransactionHash *common.Hash `json:"transactionHash"`
TransactionPosition *uint64 `json:"transactionPosition"`
Type string `json:"type"`
}
ParityTrace A trace in the desired format (Parity/OpenEtherum) See: https://openethereum.github.io/wiki/JSONRPC-trace-module
func (ParityTrace) String ¶
func (t ParityTrace) String() string
Allows for easy printing of a parity trace for debugging
type PrivateDebugAPI ¶
type PrivateDebugAPI interface {
StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex uint64, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error)
TraceTransaction(ctx context.Context, hash common.Hash, config *tracers.TraceConfig, stream *jsoniter.Stream) error
AccountRange(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, start []byte, maxResults int, nocode, nostorage, incompletes bool) (state.IteratorDump, error)
GetModifiedAccountsByNumber(ctx context.Context, startNum rpc.BlockNumber, endNum *rpc.BlockNumber) ([]common.Address, error)
GetModifiedAccountsByHash(_ context.Context, startHash common.Hash, endHash *common.Hash) ([]common.Address, error)
TraceCall(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, config *tracers.TraceConfig, stream *jsoniter.Stream) error
AccountAt(ctx context.Context, blockHash common.Hash, txIndex uint64, account common.Address) (*AccountResult, error)
}
PrivateDebugAPI Exposed RPC endpoints for debugging use
type PrivateDebugAPIImpl ¶
type PrivateDebugAPIImpl struct {
*BaseAPI
GasCap uint64
// contains filtered or unexported fields
}
PrivateDebugAPIImpl is implementation of the PrivateDebugAPI interface based on remote Db access
func NewPrivateDebugAPI ¶
func NewPrivateDebugAPI(base *BaseAPI, dbReader ethdb.RoKV, gascap uint64) *PrivateDebugAPIImpl
NewPrivateDebugAPI returns PrivateDebugAPIImpl instance
func (*PrivateDebugAPIImpl) AccountAt ¶
func (api *PrivateDebugAPIImpl) AccountAt(ctx context.Context, blockHash common.Hash, txIndex uint64, address common.Address) (*AccountResult, error)
func (*PrivateDebugAPIImpl) AccountRange ¶
func (api *PrivateDebugAPIImpl) AccountRange(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, startKey []byte, maxResults int, excludeCode, excludeStorage, excludeMissingPreimages bool) (state.IteratorDump, error)
AccountRange implements debug_accountRange. Returns a range of accounts involved in the given block range
func (*PrivateDebugAPIImpl) GetModifiedAccountsByHash ¶
func (api *PrivateDebugAPIImpl) GetModifiedAccountsByHash(ctx context.Context, startHash common.Hash, endHash *common.Hash) ([]common.Address, error)
GetModifiedAccountsByHash implements debug_getModifiedAccountsByHash. Returns a list of accounts modified in the given block.
func (*PrivateDebugAPIImpl) GetModifiedAccountsByNumber ¶
func (api *PrivateDebugAPIImpl) GetModifiedAccountsByNumber(ctx context.Context, startNumber rpc.BlockNumber, endNumber *rpc.BlockNumber) ([]common.Address, error)
GetModifiedAccountsByNumber implements debug_getModifiedAccountsByNumber. Returns a list of accounts modified in the given block.
func (*PrivateDebugAPIImpl) StorageRangeAt ¶
func (api *PrivateDebugAPIImpl) StorageRangeAt(ctx context.Context, blockHash common.Hash, txIndex uint64, contractAddress common.Address, keyStart hexutil.Bytes, maxResult int) (StorageRangeResult, error)
StorageRangeAt implements debug_storageRangeAt. Returns information about a range of storage locations (if any) for the given address.
func (*PrivateDebugAPIImpl) TraceCall ¶
func (api *PrivateDebugAPIImpl) TraceCall(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, config *tracers.TraceConfig, stream *jsoniter.Stream) error
func (*PrivateDebugAPIImpl) TraceTransaction ¶
func (api *PrivateDebugAPIImpl) TraceTransaction(ctx context.Context, hash common.Hash, config *tracers.TraceConfig, stream *jsoniter.Stream) error
TraceTransaction implements debug_traceTransaction. Returns Geth style transaction traces.
type RPCTransaction ¶
type RPCTransaction 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,omitempty"`
Tip *hexutil.Big `json:"tip,omitempty"`
FeeCap *hexutil.Big `json:"feeCap,omitempty"`
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"`
Type hexutil.Uint64 `json:"type"`
Accesses *types.AccessList `json:"accessList,omitempty"`
ChainID *hexutil.Big `json:"chainId,omitempty"`
V *hexutil.Big `json:"v"`
R *hexutil.Big `json:"r"`
S *hexutil.Big `json:"s"`
}
RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction
type RewardTraceAction ¶
type SHHAPI ¶
type SHHAPI interface {
Post(_ context.Context, _ SHHPost) (bool, error)
Version(_ context.Context) (string, error)
NewIdentity(_ context.Context) (string, error)
HasIdentity(_ context.Context, _ string) (bool, error)
NewGroup(_ context.Context) (string, error)
AddToGroup(_ context.Context, _ string) (bool, error)
NewFilter(_ context.Context, _ SHHFilter) (hexutil.Uint, error)
UninstallFilter(_ context.Context, _ hexutil.Uint) (bool, error)
GetFilterChanges(_ context.Context, _ hexutil.Uint) ([]string, error)
GetMessages(_ context.Context, _ hexutil.Uint) ([]string, error)
}
SHHAPI the interface for the shh_ RPC commands (deprecated)
type SHHAPIImpl ¶
type SHHAPIImpl struct {
// contains filtered or unexported fields
}
SHHAPIImpl data structure to store things needed for shh_ commands
func (*SHHAPIImpl) AddToGroup ¶
AddToGroup implements shh_addToGroup. Add to a group. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) GetFilterChanges ¶
GetFilterChanges implements shh_getFilterChanges. Polling method for whisper filters. Returns new messages since the last call of this method. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) GetMessages ¶
GetMessages implements shh_getMessages. Get all messages matching a filter. Unlike shh_getFilterChanges this returns all messages. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) HasIdentity ¶
HasIdentity implements shh_hasIdentity. Checks if the client hold the private keys for a given identity. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) NewFilter ¶
NewFilter implements shh_newFilter. Creates filter to notify, when client receives whisper message matching the filter options. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) NewGroup ¶
func (api *SHHAPIImpl) NewGroup(_ context.Context) (string, error)
NewGroup implements shh_newGroup. Create a new group. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) NewIdentity ¶
func (api *SHHAPIImpl) NewIdentity(_ context.Context) (string, error)
NewIdentity implements shh_newIdentity. Creates new whisper identity in the client. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) Post ¶
Post implements shh_post. Sends a whisper message. Deprecated: This function will be removed in the future.
func (*SHHAPIImpl) UninstallFilter ¶
UninstallFilter implements shh_uninstallFilter. Uninstalls a filter with given id. Deprecated: This function will be removed in the future.
type SHHFilter ¶
type SHHFilter struct {
// contains filtered or unexported fields
}
SHHFilter type for shh_newFilter command
type SHHPost ¶
type SHHPost struct {
// contains filtered or unexported fields
}
SHHPost type for shh_post command (deprecated)
type StateDiff ¶
type StateDiff struct {
// contains filtered or unexported fields
}
Implements core/state/StateWriter to provide state diffs
func (*StateDiff) CompareStates ¶
func (sd *StateDiff) CompareStates(initialIbs, ibs *state.IntraBlockState)
CompareStates uses the addresses accumulated in the sdMap and compares balances, nonces, and codes of the accounts, and fills the rest of the sdMap
func (*StateDiff) CreateContract ¶
func (*StateDiff) DeleteAccount ¶
func (*StateDiff) UpdateAccountCode ¶
func (*StateDiff) UpdateAccountData ¶
type StateDiffAccount ¶
type StateDiffAccount struct {
Balance interface{} `json:"balance"` // Can be either string "=" or mapping "*" => {"from": "hex", "to": "hex"}
Code interface{} `json:"code"`
Nonce interface{} `json:"nonce"`
Storage map[common.Hash]map[string]interface{} `json:"storage"`
}
StateDiffAccount is the part of `trace_call` response that is under "stateDiff" tag
type StateDiffBalance ¶
type StateDiffCode ¶
type StateDiffNonce ¶
type StateDiffStorage ¶
type StorageEntry ¶
StorageEntry an entry in storage of the account
type StorageMap ¶
type StorageMap map[common.Hash]StorageEntry
StorageMap a map from storage locations to StorageEntry items
type StorageRangeResult ¶
type StorageRangeResult struct {
Storage StorageMap `json:"storage"`
NextKey *common.Hash `json:"nextKey"` // nil if Storage includes the last key in the trie.
}
StorageRangeResult is the result of a debug_storageRangeAt API call.
func StorageRangeAt ¶
func StorageRangeAt(stateReader *state.PlainKVState, contractAddress common.Address, start []byte, maxResult int) (StorageRangeResult, error)
type SuicideTraceAction ¶
type TraceAPI ¶
type TraceAPI interface {
// Ad-hoc (see ./trace_adhoc.go)
ReplayBlockTransactions(ctx context.Context, blockNr rpc.BlockNumber, traceTypes []string) ([]interface{}, error)
ReplayTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
Call(ctx context.Context, call TraceCallParam, types []string, blockNr *rpc.BlockNumberOrHash) (*TraceCallResult, error)
CallMany(ctx context.Context, calls json.RawMessage, blockNr *rpc.BlockNumberOrHash) ([]*TraceCallResult, error)
RawTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
// Filtering (see ./trace_filtering.go)
Transaction(ctx context.Context, txHash common.Hash) (ParityTraces, error)
Get(ctx context.Context, txHash common.Hash, txIndicies []hexutil.Uint64) (*ParityTrace, error)
Block(ctx context.Context, blockNr rpc.BlockNumber) (ParityTraces, error)
Filter(ctx context.Context, req TraceFilterRequest, stream *jsoniter.Stream) error
}
TraceAPI RPC interface into tracing API
type TraceAPIImpl ¶
type TraceAPIImpl struct {
*BaseAPI
// contains filtered or unexported fields
}
TraceAPIImpl is implementation of the TraceAPI interface based on remote Db access
func NewTraceAPI ¶
NewTraceAPI returns NewTraceAPI instance
func (*TraceAPIImpl) Block ¶
func (api *TraceAPIImpl) Block(ctx context.Context, blockNr rpc.BlockNumber) (ParityTraces, error)
Block implements trace_block
func (*TraceAPIImpl) Call ¶
func (api *TraceAPIImpl) Call(ctx context.Context, args TraceCallParam, traceTypes []string, blockNrOrHash *rpc.BlockNumberOrHash) (*TraceCallResult, error)
Call implements trace_call.
func (*TraceAPIImpl) CallMany ¶
func (api *TraceAPIImpl) CallMany(ctx context.Context, calls json.RawMessage, blockNrOrHash *rpc.BlockNumberOrHash) ([]*TraceCallResult, error)
CallMany implements trace_callMany.
func (*TraceAPIImpl) Filter ¶
func (api *TraceAPIImpl) Filter(ctx context.Context, req TraceFilterRequest, stream *jsoniter.Stream) error
Filter implements trace_filter NOTE: We do not store full traces - we just store index for each address Pull blocks which have txs with matching address
func (*TraceAPIImpl) Get ¶
func (api *TraceAPIImpl) Get(ctx context.Context, txHash common.Hash, indicies []hexutil.Uint64) (*ParityTrace, error)
Get implements trace_get
func (*TraceAPIImpl) RawTransaction ¶
func (api *TraceAPIImpl) RawTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
RawTransaction implements trace_rawTransaction.
func (*TraceAPIImpl) ReplayBlockTransactions ¶
func (api *TraceAPIImpl) ReplayBlockTransactions(ctx context.Context, blockNr rpc.BlockNumber, traceTypes []string) ([]interface{}, error)
ReplayBlockTransactions implements trace_replayBlockTransactions.
func (*TraceAPIImpl) ReplayTransaction ¶
func (api *TraceAPIImpl) ReplayTransaction(ctx context.Context, txHash common.Hash, traceTypes []string) ([]interface{}, error)
ReplayTransaction implements trace_replayTransaction.
func (*TraceAPIImpl) Transaction ¶
func (api *TraceAPIImpl) Transaction(ctx context.Context, txHash common.Hash) (ParityTraces, error)
Transaction implements trace_transaction
type TraceAction ¶
type TraceAction struct {
// Do not change the ordering of these fields -- allows for easier comparison with other clients
Author string `json:"author,omitempty"`
RewardType string `json:"rewardType,omitempty"`
SelfDestructed string `json:"address,omitempty"`
Balance string `json:"balance,omitempty"`
CallType string `json:"callType,omitempty"`
From common.Address `json:"from"`
Gas hexutil.Big `json:"gas"`
Init hexutil.Bytes `json:"init,omitempty"`
Input hexutil.Bytes `json:"input,omitempty"`
RefundAddress string `json:"refundAddress,omitempty"`
To string `json:"to,omitempty"`
Value string `json:"value,omitempty"`
}
TraceAction A parity formatted trace action
type TraceCallParam ¶
type TraceCallParam struct {
From *common.Address `json:"from"`
To *common.Address `json:"to"`
Gas *hexutil.Uint64 `json:"gas"`
GasPrice *hexutil.Big `json:"gasPrice"`
Tip *hexutil.Big `json:"tip"`
FeeCap *hexutil.Big `json:"feeCap"`
Value *hexutil.Big `json:"value"`
Data hexutil.Bytes `json:"data"`
AccessList *types.AccessList `json:"accessList"`
// contains filtered or unexported fields
}
TraceCallParam (see SendTxArgs -- this allows optional prams plus don't use MixedcaseAddress
type TraceCallResult ¶
type TraceCallResult struct {
Output hexutil.Bytes `json:"output"`
StateDiff map[common.Address]*StateDiffAccount `json:"stateDiff"`
Trace []*ParityTrace `json:"trace"`
VmTrace *TraceCallVmTrace `json:"vmTrace"`
}
TraceCallResult is the response to `trace_call` method
type TraceCallVmTrace ¶
type TraceCallVmTrace struct {
}
TraceCallVmTrace is the part of `trace_call` response that is under "vmTrace" tag
type TraceFilterRequest ¶
type TraceFilterRequest struct {
FromBlock *hexutil.Uint64 `json:"fromBlock"`
ToBlock *hexutil.Uint64 `json:"toBlock"`
FromAddress []*common.Address `json:"fromAddress"`
ToAddress []*common.Address `json:"toAddress"`
After *uint64 `json:"after"`
Count *uint64 `json:"count"`
}
TraceFilterRequest represents the arguments for trace_filter
type TraceResult ¶
type TraceResult struct {
// Do not change the ordering of these fields -- allows for easier comparison with other clients
GasUsed *hexutil.Big `json:"gasUsed"`
Output hexutil.Bytes `json:"output"`
}
TraceResult A parity formatted trace result
type Web3API ¶
type Web3API interface {
ClientVersion(_ context.Context) (string, error)
Sha3(_ context.Context, input hexutil.Bytes) hexutil.Bytes
}
Web3API provides interfaces for the web3_ RPC commands
type Web3APIImpl ¶
type Web3APIImpl struct {
*BaseAPI
// contains filtered or unexported fields
}
func NewWeb3APIImpl ¶
func NewWeb3APIImpl(ethBackend services.ApiBackend) *Web3APIImpl
NewWeb3APIImpl returns Web3APIImpl instance
func (*Web3APIImpl) ClientVersion ¶
func (api *Web3APIImpl) ClientVersion(ctx context.Context) (string, error)
ClientVersion implements web3_clientVersion. Returns the current client version.
Source Files
¶
- daemon.go
- db_api_deprecated.go
- debug_api.go
- erigon_api.go
- erigon_block.go
- erigon_issuance.go
- erigon_receipts.go
- erigon_system.go
- error_messages.go
- eth_accounts.go
- eth_api.go
- eth_block.go
- eth_call.go
- eth_deprecated.go
- eth_filters.go
- eth_mining.go
- eth_receipts.go
- eth_system.go
- eth_txs.go
- eth_uncles.go
- net_api.go
- rpc_block.go
- send_transaction.go
- shh_api_deprecated.go
- storage_range.go
- test_util.go
- trace_adhoc.go
- trace_api.go
- trace_filtering.go
- trace_types.go
- tracing.go
- web3_api.go