Documentation ¶
Index ¶
- Variables
- func MakeNode(config *params.NodeConfig) (*node.Node, error)
- type EthNodeError
- type RPCClientError
- type StatusNode
- func (n *StatusNode) AccountKeyStore() (*keystore.KeyStore, error)
- func (n *StatusNode) AccountManager() (*accounts.Manager, error)
- func (n *StatusNode) AddPeer(url string) error
- func (n *StatusNode) Config() (*params.NodeConfig, error)
- func (n *StatusNode) EnsureSync(ctx context.Context) error
- func (n *StatusNode) GethNode() (*node.Node, error)
- func (n *StatusNode) IsRunning() bool
- func (n *StatusNode) LightEthereumService() (l *les.LightEthereum, err error)
- func (n *StatusNode) PeerCount() int
- func (n *StatusNode) RPCClient() *rpc.Client
- func (n *StatusNode) ReconnectStaticPeers() error
- func (n *StatusNode) ResetChainData(config *params.NodeConfig) error
- func (n *StatusNode) Start(config *params.NodeConfig) error
- func (n *StatusNode) Stop() error
- func (n *StatusNode) WhisperService() (w *whisper.Whisper, err error)
Constants ¶
This section is empty.
Variables ¶
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
var ( ErrNodeExists = errors.New("node is already running") ErrNoRunningNode = errors.New("there is no running node") ErrInvalidStatusNode = errors.New("status node is not properly initialized") ErrInvalidService = errors.New("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
Functions ¶
Types ¶
type RPCClientError ¶
type RPCClientError error
RPCClientError reported when rpc client is initialized.
type StatusNode ¶
type StatusNode struct {
// contains filtered or unexported fields
}
StatusNode abstracts contained geth node and provides helper methods to interact with it.
func (*StatusNode) AccountKeyStore ¶
func (n *StatusNode) AccountKeyStore() (*keystore.KeyStore, error)
AccountKeyStore exposes reference to accounts key store
func (*StatusNode) AccountManager ¶
func (n *StatusNode) AccountManager() (*accounts.Manager, error)
AccountManager exposes reference to node's accounts manager
func (*StatusNode) AddPeer ¶
func (n *StatusNode) AddPeer(url string) error
AddPeer adds new static peer node
func (*StatusNode) Config ¶
func (n *StatusNode) Config() (*params.NodeConfig, error)
Config exposes reference to running node's configuration
func (*StatusNode) EnsureSync ¶
func (n *StatusNode) EnsureSync(ctx context.Context) error
EnsureSync waits until blockchain synchronization is complete and returns.
func (*StatusNode) GethNode ¶
func (n *StatusNode) GethNode() (*node.Node, error)
GethNode returns underlying geth node.
func (*StatusNode) IsRunning ¶
func (n *StatusNode) IsRunning() bool
IsRunning confirm that node is running.
func (*StatusNode) LightEthereumService ¶
func (n *StatusNode) LightEthereumService() (l *les.LightEthereum, err error)
LightEthereumService exposes reference to LES service running on top of the node
func (*StatusNode) PeerCount ¶
func (n *StatusNode) PeerCount() int
PeerCount returns the number of connected peers.
func (*StatusNode) RPCClient ¶
func (n *StatusNode) RPCClient() *rpc.Client
RPCClient exposes reference to RPC client connected to the running node.
func (*StatusNode) ReconnectStaticPeers ¶
func (n *StatusNode) ReconnectStaticPeers() error
ReconnectStaticPeers removes and adds static peers to a server.
func (*StatusNode) ResetChainData ¶
func (n *StatusNode) ResetChainData(config *params.NodeConfig) error
ResetChainData removes chain data if node is not running.
func (*StatusNode) Start ¶
func (n *StatusNode) Start(config *params.NodeConfig) error
Start starts current StatusNode, will fail if it's already started.
func (*StatusNode) Stop ¶
func (n *StatusNode) Stop() error
Stop will stop current StatusNode. A stopped node cannot be resumed.
func (*StatusNode) WhisperService ¶
func (n *StatusNode) WhisperService() (w *whisper.Whisper, err error)
WhisperService exposes reference to Whisper service running on top of the node