seed

package
v0.0.0-...-59028f8 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainView

type ChainView struct {
	NetView *NetworkView

	Node lnrpc.LightningClient
}

ChainView couples a network view for a particulr chain, and the node that will be populating that network view.

type DnsRequest

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

type DnsServer

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

func NewDnsServer

func NewDnsServer(chainViews map[string]*ChainView, listenAddrUDP, listenAddrTCP, rootDomain string,
	authoritativeIP net.IP) *DnsServer

func (*DnsServer) Serve

func (ds *DnsServer) Serve()

type NetworkView

type NetworkView struct {
	sync.Mutex
	// contains filtered or unexported fields
}

The local view of the network

func NewNetworkView

func NewNetworkView(chain string) *NetworkView

NewNetworkView creates a new instance of a NetworkView.

func (*NetworkView) AddNode

func (nv *NetworkView) AddNode(node *lnrpc.LightningNode) (*Node, error)

Insert nodes into the map of known nodes. Existing nodes with the same Id are overwritten.

func (*NetworkView) RandomSample

func (nv *NetworkView) RandomSample(query NodeType, count int) []Node

Return a random sample matching the NodeType, or just any node if query is set to `0xFF`. Relies on random map-iteration ordering internally.

type Node

type Node struct {
	Id string

	LastSeen time.Time

	Type NodeType

	Addresses []net.TCPAddr
}

Local model of a node,

type NodeType

type NodeType uint8

A bitfield in which bit 0 indicates whether it is an IPv6 if set, and bit 1 indicates whether it uses the default port if set.

Jump to

Keyboard shortcuts

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