commands

package
v0.0.0-...-1f13f73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2021 License: GPL-3.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CALL               = "call"
	CALLCODE           = "callcode"
	DELEGATECALL       = "delegatecall"
	STATICCALL         = "staticcall"
	CREATE             = "create"
	SUICIDE            = "suicide"
	REWARD             = "reward"
	TraceTypeTrace     = "trace"
	TraceTypeStateDiff = "stateDiff"
	TraceTypeVmTrace   = "vmTrace"
)
View Source
const NotAvailableChainData = "the function %s is not available, please use --private.api.addr option instead of --datadir option"

NotAvailableChainData x

View Source
const NotAvailableDeprecated = "the method has been deprecated: %s"

NotAvailableDeprecated x

View Source
const NotImplemented = "the method is currently not implemented: %s"

NotImplemented is the URI prefix for smartcard wallets.

Variables

This section is empty.

Functions

func APIList

func APIList(ctx context.Context, db ethdb.RoKV, eth services.ApiBackend, txPool txpool.TxpoolClient, mining txpool.MiningClient, filters *filters.Filters, cfg cli.Flags, customAPIList []rpc.API) []rpc.API

APIList describes the list of available RPC apis

func HeaderByNumberOrHash

func HeaderByNumberOrHash(ctx context.Context, tx ethdb.Tx, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)

Types

type APIImpl

type APIImpl struct {
	*BaseAPI

	GasCap uint64
	// contains filtered or unexported fields
}

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

func (api *APIImpl) Accounts(ctx context.Context) ([]common.Address, error)

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

func (api *APIImpl) BlockNumber(ctx context.Context) (hexutil.Uint64, error)

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 (api *APIImpl) CallBundle(ctx context.Context, txHashes []common.Hash, stateBlockNumberOrHash rpc.BlockNumberOrHash, timeoutMilliSecondsPtr *int64) (map[string]interface{}, error)

func (*APIImpl) ChainConfig

func (api *APIImpl) ChainConfig() *params.ChainConfig

ChainConfig is necessary for gasprice.OracleBackend implementation

func (*APIImpl) ChainId

func (api *APIImpl) ChainId(ctx context.Context) (hexutil.Uint64, error)

ChainId implements eth_chainId. Returns the current ethereum chainId.

func (*APIImpl) Coinbase

func (api *APIImpl) Coinbase(ctx context.Context) (common.Address, error)

Coinbase implements eth_coinbase. Returns the current client coinbase address.

func (*APIImpl) CompileLLL

func (api *APIImpl) CompileLLL(_ context.Context, _ string) (hexutil.Bytes, error)

CompileLLL implements eth_compileLLL. Returns compiled LLL code. Deprecated: This function will be removed in the future.

func (*APIImpl) CompileSerpent

func (api *APIImpl) CompileSerpent(ctx context.Context, _ string) (hexutil.Bytes, error)

CompileSerpent implements eth_compileSerpent. Returns compiled serpent code. Deprecated: This function will be removed in the future.

func (*APIImpl) CompileSolidity

func (api *APIImpl) CompileSolidity(ctx context.Context, _ string) (hexutil.Bytes, error)

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

func (api *APIImpl) GasPrice(ctx context.Context) (*hexutil.Big, error)

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

func (api *APIImpl) GetCompilers(_ context.Context) ([]string, error)

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

func (api *APIImpl) GetLogs(ctx context.Context, crit filters.FilterCriteria) ([]*types.Log, error)

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

func (api *APIImpl) GetWork(ctx context.Context) ([4]string, error)

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

func (api *APIImpl) Hashrate(ctx context.Context) (uint64, error)

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

func (api *APIImpl) Mining(ctx context.Context) (bool, error)

Mining returns an indication if this node is currently mining.

func (*APIImpl) NewBlockFilter

func (api *APIImpl) NewBlockFilter(_ context.Context) (hexutil.Uint64, error)

NewBlockFilter new transaction filter

func (*APIImpl) NewFilter

func (api *APIImpl) NewFilter(_ context.Context, filter interface{}) (hexutil.Uint64, error)

NewFilter implements eth_newFilter. Creates an arbitrary filter object, based on filter options, to notify when the state changes (logs).

func (*APIImpl) NewHeads

func (api *APIImpl) NewHeads(ctx context.Context) (*rpc.Subscription, error)

NewHeads send a notification each time a new (header) block is appended to the chain.

func (*APIImpl) NewPendingTransactionFilter

func (api *APIImpl) NewPendingTransactionFilter(ctx context.Context) (hexutil.Uint64, error)

NewPendingTransactionFilter new transaction filter

func (*APIImpl) NewPendingTransactions

func (api *APIImpl) NewPendingTransactions(ctx context.Context) (*rpc.Subscription, error)

NewPendingTransactions send a notification each time a new (header) block is appended to the chain.

func (*APIImpl) ProtocolVersion

func (api *APIImpl) ProtocolVersion(ctx context.Context) (hexutil.Uint, error)

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

func (api *APIImpl) SendTransaction(_ context.Context, txObject interface{}) (common.Hash, error)

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

func (api *APIImpl) SignTransaction(_ context.Context, txObject interface{}) (common.Hash, error)

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.

func (*APIImpl) Syncing

func (api *APIImpl) Syncing(ctx context.Context) (interface{}, error)

Syncing implements eth_syncing. Returns a data object detaling the status of the sync process or false if not syncing.

func (*APIImpl) UninstallFilter

func (api *APIImpl) UninstallFilter(_ context.Context, index hexutil.Uint64) (bool, error)

UninstallFilter new transaction filter

type AccountResult

type AccountResult struct {
	Balance  hexutil.Big    `json:"balance"`
	Nonce    hexutil.Uint64 `json:"nonce"`
	Code     hexutil.Bytes  `json:"code"`
	CodeHash common.Hash    `json:"codeHash"`
}

type BaseAPI

type BaseAPI struct {
	// contains filtered or unexported fields
}

func NewBaseApi

func NewBaseApi(f *filters.Filters) *BaseAPI

type CallTraceAction

type CallTraceAction struct {
	From     common.Address `json:"from"`
	CallType string         `json:"callType"`
	Gas      hexutil.Big    `json:"gas"`
	Input    hexutil.Bytes  `json:"input"`
	To       common.Address `json:"to"`
	Value    hexutil.Big    `json:"value"`
}

type CreateTraceAction

type CreateTraceAction struct {
	From  common.Address `json:"from"`
	Gas   hexutil.Big    `json:"gas"`
	Init  hexutil.Bytes  `json:"init"`
	Value hexutil.Big    `json:"value"`
}

type CreateTraceResult

type CreateTraceResult struct {
	// Do not change the ordering of these fields -- allows for easier comparison with other clients
	Address *common.Address `json:"address,omitempty"`
	Code    hexutil.Bytes   `json:"code"`
	GasUsed *hexutil.Big    `json:"gasUsed"`
}

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 NewDBAPIImpl

func NewDBAPIImpl() *DBAPIImpl

NewDBAPIImpl returns NetAPIImplImpl instance

func (*DBAPIImpl) GetHex

func (api *DBAPIImpl) GetHex(_ context.Context, _ string, _ string) (hexutil.Bytes, error)

GetHex implements db_getHex. Returns binary data from the local database. Deprecated: This function will be removed in the future.

func (*DBAPIImpl) GetString

func (api *DBAPIImpl) GetString(_ context.Context, _ string, _ string) (string, error)

GetString implements db_getString. Returns string from the local database. Deprecated: This function will be removed in the future.

func (*DBAPIImpl) PutHex

func (api *DBAPIImpl) PutHex(_ context.Context, _ string, _ string, _ hexutil.Bytes) (bool, error)

PutHex implements db_putHex. Stores binary data in the local database. Deprecated: This function will be removed in the future.

func (*DBAPIImpl) PutString

func (api *DBAPIImpl) PutString(_ context.Context, _ string, _ string, _ string) (bool, error)

PutString implements db_putString. Stores a string in 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

func (api *ErigonImpl) GetLogsByHash(ctx context.Context, hash common.Hash) ([][]*types.Log, error)

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 Forks

type Forks struct {
	GenesisHash common.Hash `json:"genesis"`
	Forks       []uint64    `json:"forks"`
}

Forks is a data type to record a list of forks passed by this node

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'

func (GethTrace) String

func (p GethTrace) String() string

Allows for easy printing of a geth trace for debugging

type GethTraces

type GethTraces []*GethTrace

GethTraces an array of GethTraces

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

func (*NetAPIImpl) PeerCount

func (api *NetAPIImpl) PeerCount(_ context.Context) (hexutil.Uint, error)

PeerCount implements net_peerCount. Returns number of peers currently connected to the client. TODO: This routine currently returns a hard coded value of '25'

func (*NetAPIImpl) Version

func (api *NetAPIImpl) Version(ctx context.Context) (string, error)

Version implements net_version. Returns the current network id.

type OeTracer

type OeTracer struct {
	// contains filtered or unexported fields
}

OpenEthereum-style tracer

func (*OeTracer) CaptureAccountRead

func (ot *OeTracer) CaptureAccountRead(account common.Address) error

func (*OeTracer) CaptureAccountWrite

func (ot *OeTracer) CaptureAccountWrite(account common.Address) error

func (*OeTracer) CaptureEnd

func (ot *OeTracer) CaptureEnd(depth int, output []byte, gasUsed uint64, t time.Duration, err error) error

func (*OeTracer) CaptureFault

func (ot *OeTracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *stack.Stack, contract *vm.Contract, opDepth int, err error) error

func (*OeTracer) CaptureSelfDestruct

func (ot *OeTracer) CaptureSelfDestruct(from common.Address, to common.Address, value *big.Int)

func (*OeTracer) CaptureStart

func (ot *OeTracer) CaptureStart(depth int, from common.Address, to common.Address, precompile bool, create bool, calltype vm.CallType, input []byte, gas uint64, value *big.Int) error

func (*OeTracer) CaptureState

func (ot *OeTracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, st *stack.Stack, rData []byte, contract *vm.Contract, opDepth int, err error) error

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 ParityTraces

type ParityTraces []ParityTrace

ParityTraces An array of parity traces

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 RewardTraceAction struct {
	Author     common.Address `json:"author"`
	RewardType string         `json:"rewardType"`
	Value      hexutil.Big    `json:"value"`
}

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 NewSHHAPIImpl

func NewSHHAPIImpl() *SHHAPIImpl

NewSHHAPIImpl returns NetAPIImplImpl instance

func (*SHHAPIImpl) AddToGroup

func (api *SHHAPIImpl) AddToGroup(_ context.Context, _ string) (bool, error)

AddToGroup implements shh_addToGroup. Add to a group. Deprecated: This function will be removed in the future.

func (*SHHAPIImpl) GetFilterChanges

func (api *SHHAPIImpl) GetFilterChanges(_ context.Context, _ hexutil.Uint) ([]string, error)

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

func (api *SHHAPIImpl) GetMessages(_ context.Context, _ hexutil.Uint) ([]string, error)

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

func (api *SHHAPIImpl) HasIdentity(_ context.Context, _ string) (bool, error)

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

func (api *SHHAPIImpl) NewFilter(_ context.Context, _ SHHFilter) (hexutil.Uint, error)

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

func (api *SHHAPIImpl) Post(_ context.Context, _ SHHPost) (bool, error)

Post implements shh_post. Sends a whisper message. Deprecated: This function will be removed in the future.

func (*SHHAPIImpl) UninstallFilter

func (api *SHHAPIImpl) UninstallFilter(_ context.Context, _ hexutil.Uint) (bool, error)

UninstallFilter implements shh_uninstallFilter. Uninstalls a filter with given id. Deprecated: This function will be removed in the future.

func (*SHHAPIImpl) Version

func (api *SHHAPIImpl) Version(_ context.Context) (string, error)

Version implements shh_version. Returns the current whisper protocol version. 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 (sd *StateDiff) CreateContract(address common.Address) error

func (*StateDiff) DeleteAccount

func (sd *StateDiff) DeleteAccount(ctx context.Context, address common.Address, original *accounts.Account) error

func (*StateDiff) UpdateAccountCode

func (sd *StateDiff) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error

func (*StateDiff) UpdateAccountData

func (sd *StateDiff) UpdateAccountData(ctx context.Context, address common.Address, original, account *accounts.Account) error

func (*StateDiff) WriteAccountStorage

func (sd *StateDiff) WriteAccountStorage(ctx context.Context, address common.Address, incarnation uint64, key *common.Hash, original, value *uint256.Int) error

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 StateDiffBalance struct {
	From *hexutil.Big `json:"from"`
	To   *hexutil.Big `json:"to"`
}

type StateDiffCode

type StateDiffCode struct {
	From hexutil.Bytes `json:"from"`
	To   hexutil.Bytes `json:"to"`
}

type StateDiffNonce

type StateDiffNonce struct {
	From hexutil.Uint64 `json:"from"`
	To   hexutil.Uint64 `json:"to"`
}

type StateDiffStorage

type StateDiffStorage struct {
	From common.Hash `json:"from"`
	To   common.Hash `json:"to"`
}

type StorageEntry

type StorageEntry struct {
	Key   *common.Hash `json:"key"`
	Value common.Hash  `json:"value"`
}

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 SuicideTraceAction struct {
	Address       common.Address `json:"address"`
	RefundAddress common.Address `json:"refundAddress"`
	Balance       hexutil.Big    `json:"balance"`
}

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

func NewTraceAPI(base *BaseAPI, kv ethdb.RoKV, cfg *cli.Flags) *TraceAPIImpl

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

func (*TraceCallParam) ToMessage

func (args *TraceCallParam) ToMessage(globalGasCap uint64) types.Message

ToMessage converts CallArgs to the Message type used by the core evm

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.

func (*Web3APIImpl) Sha3

func (api *Web3APIImpl) Sha3(_ context.Context, input hexutil.Bytes) hexutil.Bytes

Sha3 implements web3_sha3. Returns Keccak-256 (not the standardized SHA3-256) of the given data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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