node

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2018 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

Defaults to tcp

Types

type Node

type Node struct {
	cmn.BaseService
	// contains filtered or unexported fields
}

func NewNode

func NewNode(config *cfg.Config) *Node

func (*Node) AddListener

func (n *Node) AddListener(l p2p.Listener)

Add a Listener to accept inbound peer connections. Add listeners before starting the Node. The first listener is the primary listener (in NodeInfo)

func (*Node) DialSeeds

func (n *Node) DialSeeds(seeds []string) error

func (*Node) EventSwitch

func (n *Node) EventSwitch() types.EventSwitch

func (*Node) NodeInfo

func (n *Node) NodeInfo() *p2p.NodeInfo

func (*Node) OnStart

func (n *Node) OnStart() error

func (*Node) OnStop

func (n *Node) OnStop()

func (*Node) RunForever

func (n *Node) RunForever()

func (*Node) Switch

func (n *Node) Switch() *p2p.Switch

type NodeGreeting

type NodeGreeting struct {
	NodeID
	Version string
	ChainID string
	Message string
	Time    time.Time
}

type NodeID

type NodeID struct {
	Name   string
	PubKey crypto.PubKey
}

type PrivNodeID

type PrivNodeID struct {
	NodeID
	PrivKey crypto.PrivKey
}

func (*PrivNodeID) SignGreeting

func (pnid *PrivNodeID) SignGreeting() *SignedNodeGreeting

type SignedNodeGreeting

type SignedNodeGreeting struct {
	NodeGreeting
	Signature crypto.Signature
}

Jump to

Keyboard shortcuts

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