Documentation
¶
Index ¶
- Variables
- func MakeNode(config *params.NodeConfig, accs *accounts.Manager, db *leveldb.DB) (*node.Node, error)
- type RPCCall
- type StartOptions
- type StatusNode
- func (n *StatusNode) AccountManager() (*accounts.Manager, error)
- func (b *StatusNode) AccountService() *accountssvc.Service
- func (n *StatusNode) AddPeer(url string) error
- func (b *StatusNode) CallPrivateRPC(inputJSON string) (string, error)
- func (b *StatusNode) CallRPC(inputJSON string) (string, error)
- func (b *StatusNode) ChatService(accountsDB *accounts.Database) *chat.Service
- func (b *StatusNode) Cleanup() error
- func (n *StatusNode) Config() *params.NodeConfig
- func (n *StatusNode) ConnectionChanged(state connection.State)
- func (n *StatusNode) Discover(topic string, max, min int) (err error)
- func (n *StatusNode) GethNode() *node.Node
- func (n *StatusNode) HTTPServer() *server.MediaServer
- func (n *StatusNode) IsRunning() bool
- func (n *StatusNode) PeerCount() int
- func (n *StatusNode) RPCClient() *rpc.Client
- func (b *StatusNode) RPCFiltersService() *rpcfilters.Service
- func (n *StatusNode) ReconnectStaticPeers() error
- func (b *StatusNode) RegisterLifecycle(s common.StatusService)
- func (n *StatusNode) ResetChainData(config *params.NodeConfig) error
- func (n *StatusNode) Server() *p2p.Server
- func (n *StatusNode) SetAppDB(db *sql.DB)
- func (n *StatusNode) SetMultiaccountsDB(db *multiaccounts.Database)
- func (n *StatusNode) Start(config *params.NodeConfig, accs *accounts.Manager) error
- func (n *StatusNode) StartDiscovery() error
- func (b *StatusNode) StartLocalNotifications() error
- func (n *StatusNode) StartWithOptions(config *params.NodeConfig, options StartOptions) error
- func (b *StatusNode) StatusPublicService() *status.Service
- func (n *StatusNode) Stop() error
- func (b *StatusNode) StopLocalNotifications() error
- func (b *StatusNode) WakuExtService() *wakuext.Service
- func (b *StatusNode) WakuService() *waku.Waku
- func (b *StatusNode) WakuV2ExtService() *wakuv2ext.Service
- func (b *StatusNode) WakuV2Service() *wakuv2.Waku
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") ErrWakuV2ServiceRegistrationFailure = errors.New("failed to register the WakuV2 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.
var ( // ErrWakuClearIdentitiesFailure clearing whisper identities has failed. ErrWakuClearIdentitiesFailure = errors.New("failed to clear waku identities") // This is a normal situation when a node is stopped. ErrRPCClientUnavailable = errors.New("JSON-RPC client is unavailable") // OpenseaKeyFromEnv passed from on env var during build time OpenseaKeyFromEnv string )
Functions ¶
Types ¶
type StartOptions ¶ added in v0.35.0
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 New ¶
func New(transactor *transactions.Transactor) *StatusNode
New makes new instance of StatusNode.
func (*StatusNode) AccountManager ¶
func (n *StatusNode) AccountManager() (*accounts.Manager, error)
AccountManager exposes reference to node's accounts manager
func (*StatusNode) AccountService ¶ added in v0.102.6
func (b *StatusNode) AccountService() *accountssvc.Service
func (*StatusNode) AddPeer ¶
func (n *StatusNode) AddPeer(url string) error
AddPeer adds new static peer node
func (*StatusNode) CallPrivateRPC ¶ added in v0.82.0
func (b *StatusNode) CallPrivateRPC(inputJSON string) (string, error)
func (*StatusNode) CallRPC ¶ added in v0.82.0
func (b *StatusNode) CallRPC(inputJSON string) (string, error)
CallRPC calls public methods on the node, we register public methods in a map and check if they can be called in this function
func (*StatusNode) ChatService ¶ added in v0.94.12
func (b *StatusNode) ChatService(accountsDB *accounts.Database) *chat.Service
func (*StatusNode) Cleanup ¶ added in v0.82.0
func (b *StatusNode) Cleanup() error
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)
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) GethNode ¶
func (n *StatusNode) GethNode() *node.Node
GethNode returns underlying geth node.
func (*StatusNode) HTTPServer ¶ added in v0.98.6
func (n *StatusNode) HTTPServer() *server.MediaServer
func (*StatusNode) IsRunning ¶
func (n *StatusNode) IsRunning() bool
IsRunning confirm that node is running.
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) RPCFiltersService ¶ added in v0.82.0
func (b *StatusNode) RPCFiltersService() *rpcfilters.Service
func (*StatusNode) ReconnectStaticPeers ¶
func (n *StatusNode) ReconnectStaticPeers() error
ReconnectStaticPeers removes and adds static peers to a server.
func (*StatusNode) RegisterLifecycle ¶ added in v0.82.0
func (b *StatusNode) RegisterLifecycle(s common.StatusService)
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) SetAppDB ¶ added in v0.82.0
func (n *StatusNode) SetAppDB(db *sql.DB)
func (*StatusNode) SetMultiaccountsDB ¶ added in v0.82.0
func (n *StatusNode) SetMultiaccountsDB(db *multiaccounts.Database)
func (*StatusNode) Start ¶
func (n *StatusNode) Start(config *params.NodeConfig, accs *accounts.Manager) 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) StartLocalNotifications ¶ added in v0.82.0
func (b *StatusNode) StartLocalNotifications() error
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) StatusPublicService ¶ added in v0.86.2
func (b *StatusNode) StatusPublicService() *status.Service
func (*StatusNode) Stop ¶
func (n *StatusNode) Stop() error
Stop will stop current StatusNode. A stopped node cannot be resumed.
func (*StatusNode) StopLocalNotifications ¶ added in v0.82.0
func (b *StatusNode) StopLocalNotifications() error
func (*StatusNode) WakuExtService ¶ added in v0.39.9
func (b *StatusNode) WakuExtService() *wakuext.Service
func (*StatusNode) WakuService ¶ added in v0.39.9
func (b *StatusNode) WakuService() *waku.Waku
func (*StatusNode) WakuV2ExtService ¶ added in v0.80.2
func (b *StatusNode) WakuV2ExtService() *wakuv2ext.Service
func (*StatusNode) WakuV2Service ¶ added in v0.80.2
func (b *StatusNode) WakuV2Service() *wakuv2.Waku