discovery

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func NewDatabase

func NewDatabase() *Database

func StartService

func StartService(myId common.Address, myAddr *net.UDPAddr, bootstrap []*Node) *Database

func (*Database) GetCopy

func (db *Database) GetCopy() map[common.Hash]*Node

type Node

type Node struct {
	ID               common.Address //public key actually
	IP               net.IP
	UDPPort, TCPPort int
	// contains filtered or unexported fields
}

Node the node that contains its public key and network address

func NewNode

func NewNode(id common.Address, ip net.IP, port int) *Node

NewNode new node with its value

func NewNodeFromString

func NewNodeFromString(id string) (*Node, error)

func NewNodeWithAddr

func NewNodeWithAddr(id common.Address, addr *net.UDPAddr) *Node

NewNodeWithAddr new node with id and network address

func (*Node) GetUDPAddr

func (n *Node) GetUDPAddr() *net.UDPAddr

func (*Node) String

func (n *Node) String() string

type NodeID

type NodeID common.Address

NodeID compatible with previous defination

type Table

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

Jump to

Keyboard shortcuts

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