node

package
v0.0.0-...-40d15cf Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

func NewNode

func NewNode(config config.NodeConfig, logger log.Logger) *Node

func (*Node) AddPeer

func (n *Node) AddPeer(p peer.Peer)

func (Node) GetPeer

func (n Node) GetPeer(id crypto.FixedHash) peer.Peer

func (Node) GetPeers

func (n Node) GetPeers() map[crypto.FixedHash]peer.Peer

func (*Node) NewInboundPeer

func (n *Node) NewInboundPeer(conn net.Conn) (err error)

NewInboundPeer handles the connection of a new peer

func (*Node) NewOutboundPeer

func (n *Node) NewOutboundPeer(address string) (err error)

Connects to a new peer (sends CmdVersion and waits for CmdVerAck)

func (*Node) Start

func (n *Node) Start()

Start starts listening for new connections on the port specified in the config file

Jump to

Keyboard shortcuts

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