discovery

package
v0.0.0-...-868bdbc Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PluginID = (*Plugin)(nil)
)

Functions

func FindNode

func FindNode(net *network.Network, targetID peer.ID, alpha int, disjointPaths int) (results []peer.ID)

FindNode queries all peers this current node acknowledges for the closest peers to a specified target ID.

All lookups are done under a number of disjoint lookups in parallel.

Queries at most #ALPHA nodes at a time per lookup, and returns all peer IDs closest to a target peer ID.

Types

type Plugin

type Plugin struct {
	*network.Plugin

	DisablePing   bool
	DisablePong   bool
	DisableLookup bool

	Routes *dht.RoutingTable
}

func (*Plugin) Cleanup

func (state *Plugin) Cleanup(net *network.Network)

func (*Plugin) PeerDisconnect

func (state *Plugin) PeerDisconnect(client *network.PeerClient)

PeerDisconnect run when a peer disconnected.

func (*Plugin) Receive

func (state *Plugin) Receive(ctx *network.PluginContext) error

func (*Plugin) Startup

func (state *Plugin) Startup(net *network.Network)

Jump to

Keyboard shortcuts

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