Documentation ¶
Index ¶
- Variables
- func MakeNode(config *params.NodeConfig, accs *accounts.Manager, db *leveldb.DB) (*node.Node, error)
- type StartOptions
- type StatusNode
- func (n *StatusNode) AccountManager() (*accounts.Manager, error)
- func (n *StatusNode) AddPeer(url string) error
- func (n *StatusNode) BrowsersService() (s *browsers.Service, err error)
- func (n *StatusNode) ChaosModeCheckRPCClientsUpstreamURL(on bool) error
- func (n *StatusNode) Config() *params.NodeConfig
- func (n *StatusNode) ConnectionChanged(state connection.State) error
- func (n *StatusNode) Discover(topic string, max, min int) (err error)
- func (n *StatusNode) EnsureSync(ctx context.Context) error
- func (n *StatusNode) GethNode() *node.Node
- func (n *StatusNode) IsRunning() bool
- func (n *StatusNode) LightEthereumService() (l *les.LightEthereum, err error)
- func (n *StatusNode) LocalNotificationsService() (s *localnotifications.Service, err error)
- func (n *StatusNode) PeerCount() int
- func (n *StatusNode) PeerService() (st *peer.Service, err error)
- func (n *StatusNode) PermissionsService() (s *permissions.Service, err error)
- func (n *StatusNode) RPCClient() *rpc.Client
- func (n *StatusNode) RPCPrivateClient() *rpc.Client
- func (n *StatusNode) ReconnectStaticPeers() error
- func (n *StatusNode) ResetChainData(config *params.NodeConfig) error
- func (n *StatusNode) Server() *p2p.Server
- func (n *StatusNode) Start(config *params.NodeConfig, accs *accounts.Manager, ...) error
- func (n *StatusNode) StartDiscovery() error
- func (n *StatusNode) StartWithOptions(config *params.NodeConfig, options StartOptions) error
- func (n *StatusNode) StatusService() (st *status.Service, err error)
- func (n *StatusNode) Stop() error
- func (n *StatusNode) WakuExtService() (s *wakuext.Service, err error)
- func (n *StatusNode) WakuService() (w *waku.Waku, err error)
- func (n *StatusNode) WalletService() (s *wallet.Service, err error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrNodeRunning = errors.New("node is already running") ErrNoGethNode = errors.New("geth node is not available") ErrNoRunningNode = errors.New("there is no running node") ErrAccountKeyStoreMissing = errors.New("account key store is not set") ErrServiceUnknown = errors.New("service unknown") ErrDiscoveryRunning = errors.New("discovery is already running") )
errors
var ( ErrNodeMakeFailureFormat = "error creating p2p node: %s" ErrWakuServiceRegistrationFailure = errors.New("failed to register the Waku service") ErrLightEthRegistrationFailure = errors.New("failed to register the LES service") ErrLightEthRegistrationFailureUpstreamEnabled = errors.New("failed to register the LES service, upstream is also configured") ErrPersonalServiceRegistrationFailure = errors.New("failed to register the personal api service") ErrStatusServiceRegistrationFailure = errors.New("failed to register the Status service") ErrPeerServiceRegistrationFailure = errors.New("failed to register the Peer service") )
Errors related to node and services creation.
Functions ¶
Types ¶
type StartOptions ¶ added in v0.35.0
type StartOptions struct { Services []node.ServiceConstructor StartDiscovery bool AccountsManager *accounts.Manager }
StartOptions allows to control some parameters of Start() method.
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) 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) BrowsersService ¶ added in v0.35.0
func (n *StatusNode) BrowsersService() (s *browsers.Service, err error)
BrowsersService returns browsers.Service instance if it was started.
func (*StatusNode) ChaosModeCheckRPCClientsUpstreamURL ¶ added in v0.35.0
func (n *StatusNode) ChaosModeCheckRPCClientsUpstreamURL(on bool) error
ChaosModeCheckRPCClientsUpstreamURL updates RPCClient and RPCPrivateClient upstream URLs, if defined, without restarting the node. This is required for the Chaos Unicorn Day. Additionally, if the passed URL is Infura, it changes it to httpstat.us/500.
func (*StatusNode) Config ¶
func (n *StatusNode) Config() *params.NodeConfig
Config exposes reference to running node's configuration
func (*StatusNode) ConnectionChanged ¶ added in v0.79.0
func (n *StatusNode) ConnectionChanged(state connection.State) error
func (*StatusNode) Discover ¶
func (n *StatusNode) Discover(topic string, max, min int) (err error)
Discover sets up the discovery for a specific topic.
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
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) LocalNotificationsService ¶ added in v0.62.16
func (n *StatusNode) LocalNotificationsService() (s *localnotifications.Service, err error)
LocalNotificationsService returns localnotifications.Service instance if it was started.
func (*StatusNode) PeerCount ¶
func (n *StatusNode) PeerCount() int
PeerCount returns the number of connected peers.
func (*StatusNode) PeerService ¶
func (n *StatusNode) PeerService() (st *peer.Service, err error)
PeerService exposes reference to peer service running on top of the node.
func (*StatusNode) PermissionsService ¶ added in v0.35.0
func (n *StatusNode) PermissionsService() (s *permissions.Service, err error)
PermissionsService returns browsers.Service instance if it was started.
func (*StatusNode) RPCClient ¶
func (n *StatusNode) RPCClient() *rpc.Client
RPCClient exposes reference to RPC client connected to the running node.
func (*StatusNode) RPCPrivateClient ¶
func (n *StatusNode) RPCPrivateClient() *rpc.Client
RPCPrivateClient exposes reference to RPC client connected to the running node that can call both public and private APIs.
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) Server ¶
func (n *StatusNode) Server() *p2p.Server
Server retrieves the currently running P2P network layer.
func (*StatusNode) Start ¶
func (n *StatusNode) Start(config *params.NodeConfig, accs *accounts.Manager, services ...node.ServiceConstructor) error
Start starts current StatusNode, failing if it's already started. It accepts a list of services that should be added to the node.
func (*StatusNode) StartDiscovery ¶ added in v0.35.0
func (n *StatusNode) StartDiscovery() error
StartDiscovery starts the peers discovery protocols depending on the node config.
func (*StatusNode) StartWithOptions ¶ added in v0.35.0
func (n *StatusNode) StartWithOptions(config *params.NodeConfig, options StartOptions) error
StartWithOptions starts current StatusNode, failing if it's already started. It takes some options that allows to further configure starting process.
func (*StatusNode) StatusService ¶
func (n *StatusNode) StatusService() (st *status.Service, err error)
StatusService exposes reference to status service running on top of the node
func (*StatusNode) Stop ¶
func (n *StatusNode) Stop() error
Stop will stop current StatusNode. A stopped node cannot be resumed.
func (*StatusNode) WakuExtService ¶ added in v0.39.9
func (n *StatusNode) WakuExtService() (s *wakuext.Service, err error)
WakuExtService exposes reference to shh extension service running on top of the node
func (*StatusNode) WakuService ¶ added in v0.39.9
func (n *StatusNode) WakuService() (w *waku.Waku, err error)
WakuService exposes reference to Waku service running on top of the node
func (*StatusNode) WalletService ¶ added in v0.35.0
func (n *StatusNode) WalletService() (s *wallet.Service, err error)
WalletService returns wallet.Service instance if it was started.