client

package
v0.0.0-...-8f649d9 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is an Ethereum JsonRPC client

func NewClient

func NewClient(addr string) *Client

NewClient creates a new Ethereum Jsonrpc client

func (*Client) Eth

func (c *Client) Eth() *Eth

Eth returns a handle on the eth endpoints.

func (*Client) Net

func (c *Client) Net() *Net

Net returns a handle on the net endpoints.

func (*Client) Web3

func (c *Client) Web3() *Web3

Web3 returns a handle on the web3 endpoints.

type Eth

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

Eth is used to query the eth service

func (*Eth) BlockNumber

func (c *Eth) BlockNumber() (uint64, error)

BlockNumber returns the number of most recent block.

func (*Eth) GetBlockByHash

func (c *Eth) GetBlockByHash(hash types.Hash, full bool) (*types.Block, error)

GetBlockByHash returns information about a block by hash.

func (*Eth) GetBlockByNumber

func (c *Eth) GetBlockByNumber(number uint64, full bool) (*types.Block, error)

GetBlockByNumber returns information about a block by block number.

type Net

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

Net is used to query the net service

func (*Net) Listening

func (c *Net) Listening() (bool, error)

Listening returns true if client is actively listening for network connections

func (*Net) PeerCount

func (c *Net) PeerCount() (uint64, error)

PeerCount returns number of peers currently connected to the client

func (*Net) Version

func (c *Net) Version() (uint64, error)

Version returns the current network id

type Web3

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

Web3 is used to query the web3 service

func (*Web3) ClientVersion

func (c *Web3) ClientVersion() (string, error)

ClientVersion returns the current client version

func (*Web3) Sha3

func (c *Web3) Sha3(val string) (string, error)

Sha3 returns Keccak-256 (not the standardized SHA3-256) of the given data

Jump to

Keyboard shortcuts

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