Documentation ¶
Index ¶
- Variables
- func MakeNode(config *params.NodeConfig) (*node.Node, error)
- type EthNodeError
- type NodeManager
- func (m *NodeManager) AccountKeyStore() (*keystore.KeyStore, error)
- func (m *NodeManager) AccountManager() (*accounts.Manager, error)
- func (m *NodeManager) AddPeer(url string) error
- func (m *NodeManager) EnsureSync(ctx context.Context) error
- func (m *NodeManager) IsNodeRunning() bool
- func (m *NodeManager) LightEthereumService() (*les.LightEthereum, error)
- func (m *NodeManager) Node() (*node.Node, error)
- func (m *NodeManager) NodeConfig() (*params.NodeConfig, error)
- func (m *NodeManager) PeerCount() int
- func (m *NodeManager) PopulateStaticPeers() error
- func (m *NodeManager) RPCClient() *rpc.Client
- func (m *NodeManager) ResetChainData() error
- func (m *NodeManager) StartNode(config *params.NodeConfig) error
- func (m *NodeManager) StopNode() error
- func (m *NodeManager) WhisperService() (*whisper.Whisper, error)
- type RPCClientError
Constants ¶
This section is empty.
Variables ¶
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
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 ¶
Types ¶
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.