Documentation ¶
Overview ¶
Package gethclient provides an RPC client for geth-specific APIs.
Index ¶
- type AccountResult
- type Client
- func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int, ...) ([]byte, error)
- func (ec *Client) CreateAccessList(ctx context.Context, msg ethereum.CallMsg) (*types.AccessList, uint64, string, error)
- func (ec *Client) GCStats(ctx context.Context) (*debug.GCStats, error)
- func (ec *Client) GetNodeInfo(ctx context.Context) (*p2p.NodeInfo, error)
- func (ec *Client) GetProof(ctx context.Context, account common.Address, keys []string, ...) (*AccountResult, error)
- func (ec *Client) MemStats(ctx context.Context) (*runtime.MemStats, error)
- func (ec *Client) SetHead(ctx context.Context, number *big.Int) error
- func (ec *Client) SubscribePendingTransactions(ctx context.Context, ch chan<- common.Hash) (*rpc.ClientSubscription, error)
- type OverrideAccount
- type StorageResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountResult ¶
type AccountResult struct { Address common.Address `json:"address"` AccountProof []string `json:"accountProof"` Balance *big.Int `json:"balance"` CodeHash common.Hash `json:"codeHash"` Nonce uint64 `json:"nonce"` StorageHash common.Hash `json:"storageHash"` StorageProof []StorageResult `json:"storageProof"` }
AccountResult is the result of a GetProof operation.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around rpc.Client that implements geth-specific functionality.
If you want to use the standardized Ethereum RPC functionality, use ethclient.Client instead.
func (*Client) CallContract ¶
func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int, overrides *map[common.Address]OverrideAccount) ([]byte, error)
CallContract executes a message call transaction, which is directly executed in the VM of the node, but never mined into the blockchain.
blockNumber selects the block height at which the call runs. It can be nil, in which case the code is taken from the latest known block. Note that state from very old blocks might not be available.
overrides specifies a map of contract states that should be overwritten before executing the message call. Please use ethclient.CallContract instead if you don't need the override functionality.
func (*Client) CreateAccessList ¶
func (ec *Client) CreateAccessList(ctx context.Context, msg ethereum.CallMsg) (*types.AccessList, uint64, string, error)
CreateAccessList tries to create an access list for a specific transaction based on the current pending state of the blockchain.
func (*Client) GetNodeInfo ¶
GetNodeInfo retrieves the node info of a geth node.
func (*Client) GetProof ¶
func (ec *Client) GetProof(ctx context.Context, account common.Address, keys []string, blockNumber *big.Int) (*AccountResult, error)
GetProof returns the account and storage values of the specified account including the Merkle-proof. The block number can be nil, in which case the value is taken from the latest known block.
func (*Client) SetHead ¶
SetHead sets the current head of the local chain by block number. Note, this is a destructive action and may severely damage your chain. Use with extreme caution.
func (*Client) SubscribePendingTransactions ¶
func (ec *Client) SubscribePendingTransactions(ctx context.Context, ch chan<- common.Hash) (*rpc.ClientSubscription, error)
SubscribePendingTransactions subscribes to new pending transactions.
type OverrideAccount ¶
type OverrideAccount struct { Nonce uint64 `json:"nonce"` Code []byte `json:"code"` Balance *big.Int `json:"balance"` State map[common.Hash]common.Hash `json:"state"` StateDiff map[common.Hash]common.Hash `json:"stateDiff"` }
OverrideAccount specifies the state of an account to be overridden.