ethrpc

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 16 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Nodes []NodeConfig

	ChaindID int // expected ChainID so we confirm on connect..
	TestMode bool
}

func (*Config) AddNode

func (c *Config) AddNode(nodeConfig NodeConfig)

type NodeConfig

type NodeConfig struct {
	URL                 string
	MaxRequestPerSecond float64
}

type Provider

type Provider struct {
	*ethclient.Client
	Config *Config
	RPC    *rpc.Client
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(ethURL string, optClient ...*http.Client) (*Provider, error)

func NewProviderWithConfig

func NewProviderWithConfig(config *Config, optClient ...*http.Client) (*Provider, error)

func (*Provider) BlockByNumber

func (s *Provider) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

func (*Provider) ChainID

func (s *Provider) ChainID(ctx context.Context) (*big.Int, error)

func (*Provider) Dial

func (s *Provider) Dial() error

func (*Provider) TransactionDetails

func (s *Provider) TransactionDetails(ctx context.Context, txnHash common.Hash) (bool, *types.Receipt, *types.Transaction, string, error)

Jump to

Keyboard shortcuts

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