Documentation ¶
Index ¶
- Variables
- func HaltOnInterruptSignal(nodeManager *NodeManager)
- func HaltOnPanic()
- func MakeNode(config *params.NodeConfig, deliveryServer whisper.DeliveryServer) (*node.Node, error)
- type LogDeliveryService
- 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) 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) PopulateStaticPeers() error
- func (m *NodeManager) RPCClient() *rpc.Client
- func (m *NodeManager) ResetChainData() (<-chan struct{}, error)
- func (m *NodeManager) RestartNode() (<-chan struct{}, error)
- func (m *NodeManager) StartNode(config *params.NodeConfig) (<-chan struct{}, error)
- func (m *NodeManager) StopNode() (<-chan struct{}, error)
- func (m *NodeManager) WhisperService() (*whisper.Whisper, error)
- type SyncPoll
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
var ( ErrStartAborted = errors.New("node synchronization timeout before starting") ErrSyncAborted = errors.New("node synchronization timeout before completion") )
errors
Functions ¶
func HaltOnInterruptSignal ¶
func HaltOnInterruptSignal(nodeManager *NodeManager)
HaltOnInterruptSignal stops node and panics if you press Ctrl-C enough times
func HaltOnPanic ¶
func HaltOnPanic()
HaltOnPanic recovers from panic, logs issue, sends upward notification, and exits
func MakeNode ¶
func MakeNode(config *params.NodeConfig, deliveryServer whisper.DeliveryServer) (*node.Node, error)
MakeNode create a geth node entity
Types ¶
type LogDeliveryService ¶
type LogDeliveryService struct{}
LogDeliveryService implements the whisper.DeliveryServer which logs out stats of whisper.MessageState to the log.
func (LogDeliveryService) SendState ¶
func (ld LogDeliveryService) SendState(state whisper.MessageState)
SendState logs incoming whisper.MesssageState into the log.
type NodeManager ¶
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) 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) 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() (<-chan struct{}, error)
ResetChainData remove chain data from data directory. Node is stopped, and new node is started, with clean data directory.
func (*NodeManager) RestartNode ¶
func (m *NodeManager) RestartNode() (<-chan struct{}, error)
RestartNode restart running Status node, fails if node is not running
func (*NodeManager) StartNode ¶
func (m *NodeManager) StartNode(config *params.NodeConfig) (<-chan struct{}, error)
StartNode start Status node, fails if node is already started
func (*NodeManager) StopNode ¶
func (m *NodeManager) StopNode() (<-chan struct{}, 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 SyncPoll ¶
type SyncPoll struct {
// contains filtered or unexported fields
}
SyncPoll provides a structure that allows us to check the status of ethereum node synchronization.
func NewSyncPoll ¶
func NewSyncPoll(leth *les.LightEthereum) *SyncPoll
NewSyncPoll returns a new instance of SyncPoll.