node

package
v0.0.0-...-ee99c87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2018 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNodeRunning = errors.New("node is already running")
	ErrNodeStopped = errors.New("node is not started")
)

Functions

This section is empty.

Types

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node is a container for registering services.

func (*Node) Restart

func (n *Node) Restart() error

Restart stop a running node and start a new one.

func (*Node) Start

func (n *Node) Start() error

Start create a p2p node.

func (*Node) Stop

func (n *Node) Stop() error

Stop terminates the running the node and the services registered.

type Service

type Service interface {
	// Protocols retrieves the P2P protocols the service wishes to start.
	Protocols() []p2p.Protocol

	Start(server *p2p.Server) error

	Stop() error
}

Service registers to node after node starts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL