kademlia

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

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

func New

func New(r *enr.Record) *Table

func (*Table) FindClosest

func (kt *Table) FindClosest(target [32]byte, count int) []*enr.Record

FindClosest returns the n closest nodes in the local table to target. It does a full table scan since the actual algorithm to do this is quite complex and the table is not expected to be that large.

func (*Table) Insert

func (kt *Table) Insert(node *enr.Record)

Inserts a node record into the Kademlia Table by putting it in the appropriate k-bucket based on distance.

Jump to

Keyboard shortcuts

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