Documentation ¶
Index ¶
- type Client
- type InstrumentedClient
- func (ic *InstrumentedClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (ic *InstrumentedClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (ic *InstrumentedClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (ic *InstrumentedClient) BlockNumber(ctx context.Context) (uint64, error)
- func (ic *InstrumentedClient) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (ic *InstrumentedClient) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error)
- func (ic *InstrumentedClient) ChainID(ctx context.Context) (*big.Int, error)
- func (ic *InstrumentedClient) Close()
- func (ic *InstrumentedClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
- func (ic *InstrumentedClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
- func (ic *InstrumentedClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)
- func (ic *InstrumentedClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (ic *InstrumentedClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (ic *InstrumentedClient) NetworkID(ctx context.Context) (*big.Int, error)
- func (ic *InstrumentedClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
- func (ic *InstrumentedClient) PeerCount(ctx context.Context) (uint64, error)
- func (ic *InstrumentedClient) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error)
- func (ic *InstrumentedClient) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
- func (ic *InstrumentedClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (ic *InstrumentedClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (ic *InstrumentedClient) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error)
- func (ic *InstrumentedClient) PendingTransactionCount(ctx context.Context) (uint, error)
- func (ic *InstrumentedClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (ic *InstrumentedClient) StorageAt(ctx context.Context, account common.Address, key common.Hash, ...) ([]byte, error)
- func (ic *InstrumentedClient) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (ic *InstrumentedClient) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error)
- func (ic *InstrumentedClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (ic *InstrumentedClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error)
- func (ic *InstrumentedClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
- func (ic *InstrumentedClient) TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error)
- func (ic *InstrumentedClient) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error)
- func (ic *InstrumentedClient) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)
- func (ic *InstrumentedClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
- func (ic *InstrumentedClient) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error)
- type InstrumentedRPCClient
- func (ic *InstrumentedRPCClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) error
- func (ic *InstrumentedRPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
- func (ic *InstrumentedRPCClient) Client() Client
- func (ic *InstrumentedRPCClient) Close()
- func (ic *InstrumentedRPCClient) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*rpc.ClientSubscription, error)
- type RPC
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Close() ChainID(ctx context.Context) (*big.Int, error) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) BlockNumber(ctx context.Context) (uint64, error) PeerCount(ctx context.Context) (uint64, error) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error) TransactionSender(ctx context.Context, tx *types.Transaction, block common.Hash, index uint) (common.Address, error) TransactionCount(ctx context.Context, blockHash common.Hash) (uint, error) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) NetworkID(ctx context.Context) (*big.Int, error) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error) StorageAt(ctx context.Context, account common.Address, key common.Hash, blockNumber *big.Int) ([]byte, error) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) PendingBalanceAt(ctx context.Context, account common.Address) (*big.Int, error) PendingStorageAt(ctx context.Context, account common.Address, key common.Hash) ([]byte, error) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) PendingTransactionCount(ctx context.Context) (uint, error) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) CallContractAtHash(ctx context.Context, msg ethereum.CallMsg, blockHash common.Hash) ([]byte, error) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) SuggestGasPrice(ctx context.Context) (*big.Int, error) SuggestGasTipCap(ctx context.Context) (*big.Int, error) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) SendTransaction(ctx context.Context, tx *types.Transaction) error }
type InstrumentedClient ¶
type InstrumentedClient struct {
// contains filtered or unexported fields
}
InstrumentedClient is an Ethereum client that tracks Prometheus metrics for each call.
func NewInstrumentedClient ¶
func NewInstrumentedClient(c *rpc.Client, m *metrics.Metrics) *InstrumentedClient
NewInstrumentedClient creates a new instrumented client. It takes a concrete *rpc.Client to prevent people from passing in an already instrumented client.
func (*InstrumentedClient) BlockByHash ¶
func (*InstrumentedClient) BlockByNumber ¶
func (*InstrumentedClient) BlockNumber ¶
func (ic *InstrumentedClient) BlockNumber(ctx context.Context) (uint64, error)
func (*InstrumentedClient) CallContract ¶
func (*InstrumentedClient) CallContractAtHash ¶
func (*InstrumentedClient) Close ¶
func (ic *InstrumentedClient) Close()
func (*InstrumentedClient) EstimateGas ¶
func (ic *InstrumentedClient) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
func (*InstrumentedClient) FilterLogs ¶
func (*InstrumentedClient) HeaderByHash ¶
func (*InstrumentedClient) HeaderByNumber ¶
func (*InstrumentedClient) PeerCount ¶
func (ic *InstrumentedClient) PeerCount(ctx context.Context) (uint64, error)
func (*InstrumentedClient) PendingBalanceAt ¶
func (*InstrumentedClient) PendingCallContract ¶
func (ic *InstrumentedClient) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error)
func (*InstrumentedClient) PendingCodeAt ¶
func (*InstrumentedClient) PendingNonceAt ¶
func (*InstrumentedClient) PendingStorageAt ¶
func (*InstrumentedClient) PendingTransactionCount ¶
func (ic *InstrumentedClient) PendingTransactionCount(ctx context.Context) (uint, error)
func (*InstrumentedClient) SendTransaction ¶
func (ic *InstrumentedClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*InstrumentedClient) SubscribeFilterLogs ¶
func (*InstrumentedClient) SubscribeNewHead ¶
func (*InstrumentedClient) SuggestGasPrice ¶
func (*InstrumentedClient) SuggestGasTipCap ¶
func (*InstrumentedClient) SyncProgress ¶
func (ic *InstrumentedClient) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error)
func (*InstrumentedClient) TransactionByHash ¶
func (ic *InstrumentedClient) TransactionByHash(ctx context.Context, hash common.Hash) (*types.Transaction, bool, error)
func (*InstrumentedClient) TransactionCount ¶
func (*InstrumentedClient) TransactionInBlock ¶
func (ic *InstrumentedClient) TransactionInBlock(ctx context.Context, blockHash common.Hash, index uint) (*types.Transaction, error)
func (*InstrumentedClient) TransactionReceipt ¶
func (*InstrumentedClient) TransactionSender ¶
type InstrumentedRPCClient ¶
type InstrumentedRPCClient struct {
// contains filtered or unexported fields
}
InstrumentedRPCClient is an RPC client that tracks Prometheus metrics for each call.
func NewInstrumentedRPC ¶
func NewInstrumentedRPC(c *rpc.Client, m *metrics.Metrics) *InstrumentedRPCClient
NewInstrumentedRPC creates a new instrumented RPC client. It takes a concrete *rpc.Client to prevent people from passing in an already instrumented client.
func (*InstrumentedRPCClient) BatchCallContext ¶
func (*InstrumentedRPCClient) CallContext ¶
func (ic *InstrumentedRPCClient) CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
func (*InstrumentedRPCClient) Client ¶ added in v0.3.0
func (ic *InstrumentedRPCClient) Client() Client
func (*InstrumentedRPCClient) Close ¶
func (ic *InstrumentedRPCClient) Close()
func (*InstrumentedRPCClient) EthSubscribe ¶
func (ic *InstrumentedRPCClient) EthSubscribe(ctx context.Context, channel interface{}, args ...interface{}) (*rpc.ClientSubscription, error)
Click to show internal directories.
Click to hide internal directories.