dht

package
v0.0.0-...-54ab005 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlphaValue = 3

Alpha is the concurrency factor for asynchronous requests.

View Source
var KValue = 20

K is the maximum number of requests to perform before returning failure.

View Source
var PoolSize = 6

Pool size is the number of nodes used for group find/set RPC calls

Functions

This section is empty.

Types

type DHT

type DHT struct {
	AutoRefresh     bool
	RtRefreshPeriod time.Duration
	// contains filtered or unexported fields
}

func NewDHT

func NewDHT(id common.PeerId) *DHT

NewDHT creates a new DHT with the specified host and options.

func (*DHT) BetterPeers

func (dht *DHT) BetterPeers(id common.PeerId, count int) []common.PeerIDAddressPair

func (*DHT) Contains

func (dht *DHT) Contains(peer common.PeerId) bool

func (*DHT) Remove

func (dht *DHT) Remove(peer common.PeerId)

func (*DHT) RouteTable

func (dht *DHT) RouteTable() *kb.RouteTable

RouteTable return dht's routeTable

func (*DHT) Update

func (dht *DHT) Update(peer common.PeerId, addr string) bool

Update signals the routeTable to Update its last-seen status on the given peer.

Directories

Path Synopsis
package kbucket implements a kademlia 'k-bucket' routing table.
package kbucket implements a kademlia 'k-bucket' routing table.

Jump to

Keyboard shortcuts

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