node

package
v0.0.0-...-adbc7b5 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNodeExists                  = errors.New("node is already running")
	ErrNoRunningNode               = errors.New("there is no running node")
	ErrInvalidNodeManager          = errors.New("node manager is not properly initialized")
	ErrInvalidWhisperService       = errors.New("whisper service is unavailable")
	ErrInvalidLightEthereumService = errors.New("LES service is unavailable")
	ErrInvalidAccountManager       = errors.New("could not retrieve account manager")
	ErrAccountKeyStoreMissing      = errors.New("account key store is not set")
	ErrRPCClient                   = errors.New("failed to init RPC client")
)

errors

View Source
var (
	ErrEthServiceRegistrationFailure     = errors.New("failed to register the Ethereum service")
	ErrWhisperServiceRegistrationFailure = errors.New("failed to register the Whisper service")
	ErrLightEthRegistrationFailure       = errors.New("failed to register the LES service")
	ErrNodeMakeFailure                   = errors.New("error creating p2p node")
	ErrNodeRunFailure                    = errors.New("error running p2p node")
	ErrNodeStartFailure                  = errors.New("error starting p2p node")
)

node-related errors

Functions

func MakeNode

func MakeNode(config *params.NodeConfig) (*node.Node, error)

MakeNode create a geth node entity

Types

type EthNodeError

type EthNodeError error

EthNodeError is reported when node crashed on start up.

type NodeManager

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

NodeManager manages Status node (which abstracts contained geth node) nolint: golint should be fixed at https://github.com/status-im/status-go/issues/200

func NewNodeManager

func NewNodeManager() *NodeManager

NewNodeManager makes new instance of node manager

func (*NodeManager) AccountKeyStore

func (m *NodeManager) AccountKeyStore() (*keystore.KeyStore, error)

AccountKeyStore exposes reference to accounts key store

func (*NodeManager) AccountManager

func (m *NodeManager) AccountManager() (*accounts.Manager, error)

AccountManager exposes reference to node's accounts manager

func (*NodeManager) AddPeer

func (m *NodeManager) AddPeer(url string) error

AddPeer adds new static peer node

func (*NodeManager) EnsureSync

func (m *NodeManager) EnsureSync(ctx context.Context) error

EnsureSync waits until blockchain synchronization is complete and returns.

func (*NodeManager) IsNodeRunning

func (m *NodeManager) IsNodeRunning() bool

IsNodeRunning confirm that node is running

func (*NodeManager) LightEthereumService

func (m *NodeManager) LightEthereumService() (*les.LightEthereum, error)

LightEthereumService exposes reference to LES service running on top of the node

func (*NodeManager) Node

func (m *NodeManager) Node() (*node.Node, error)

Node returns underlying Status node

func (*NodeManager) NodeConfig

func (m *NodeManager) NodeConfig() (*params.NodeConfig, error)

NodeConfig exposes reference to running node's configuration

func (*NodeManager) PeerCount

func (m *NodeManager) PeerCount() int

PeerCount returns the number of connected peers.

func (*NodeManager) PopulateStaticPeers

func (m *NodeManager) PopulateStaticPeers() error

PopulateStaticPeers connects current node with our publicly available LES/SHH/Swarm cluster

func (*NodeManager) RPCClient

func (m *NodeManager) RPCClient() *rpc.Client

RPCClient exposes reference to RPC client connected to the running node.

func (*NodeManager) ResetChainData

func (m *NodeManager) ResetChainData() error

ResetChainData removes chain data if node is not running.

func (*NodeManager) StartNode

func (m *NodeManager) StartNode(config *params.NodeConfig) error

StartNode start Status node, fails if node is already started

func (*NodeManager) StopNode

func (m *NodeManager) StopNode() error

StopNode stop Status node. Stopped node cannot be resumed.

func (*NodeManager) WhisperService

func (m *NodeManager) WhisperService() (*whisper.Whisper, error)

WhisperService exposes reference to Whisper service running on top of the node

type RPCClientError

type RPCClientError error

RPCClientError reported when rpc client is initialized.

Jump to

Keyboard shortcuts

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