net

package
v0.0.0-...-d05a9eb Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Net

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

Net - The Net Module

func NewNet

func NewNet(provider providers.ProviderInterface) *Net

NewNet - Net Module constructor to set the default provider

func (*Net) GetPeerCount

func (net *Net) GetPeerCount() (types.ComplexIntResponse, error)

GetPeerCount - Returns number of peers currently connected to the client. Reference: https://github.com/ethereum/wiki/wiki/JSON-RPC#net_peercount Parameters:

  • none

Returns:

  • QUANTITY - integer of the number of connected peers.

func (*Net) GetVersion

func (net *Net) GetVersion() (string, error)

GetVersion - Returns the current network id. Reference: https://github.com/ethereum/wiki/wiki/JSON-RPC#net_version Parameters:

  • none

Returns:

  • String - The current network id. "1": Ethereum Mainnet "2": Morden Testnet (deprecated) "3": Ropsten Testnet "4": Rinkeby Testnet "42": Kovan Testnet

func (*Net) IsListening

func (net *Net) IsListening() (bool, error)

IsListening - Returns true if client is actively listening for network connections. Reference: https://github.com/ethereum/wiki/wiki/JSON-RPC#net_listening Parameters:

  • none

Returns:

  • Boolean - true when listening, otherwise false.

Jump to

Keyboard shortcuts

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