kdht

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Copyright © 2021 Miga Labs

Index

Constants

This section is empty.

Variables

View Source
var (
	ModuleName = "KDHT-DISC"
)

Functions

func NewDiscoveryPeers

func NewDiscoveryPeers(ctx context.Context) discoveredPeers

func ReadIpfsBootnodeFile

func ReadIpfsBootnodeFile(jfile string) ([]peer.AddrInfo, error)

ImportBootNodeList This method will read the bootnodes list in string format and create an enode array with the parsed ENRs of the bootnodes. @param import_json_file represents the file where to read the bootnodes from. This file is configured in the config file.

func ReqIpfsHostInfo

func ReqIpfsHostInfo(h host.Host, peerID peer.ID, p *models.Peer) error

Types

type IPFSDiscService

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

IPFS discovery service with Kademlia DHT https://github.com/libp2p/go-libp2p-kad-dht Fulfilling the basic PeerDiscovery interfce for the Armiarma Crawler

func NewIPFSDiscService

func NewIPFSDiscService(ctx context.Context, h host.Host, protocols []string, bootstrapnodes []peer.AddrInfo, timeout time.Duration) IPFSDiscService

func (*IPFSDiscService) Next

func (disc *IPFSDiscService) Next() bool

return the the true if there is any new discovered peer, false if not

func (*IPFSDiscService) Peer

func (disc *IPFSDiscService) Peer() (models.Peer, bool)

fills the given peer struct that satifies the core.Basic standars empty

func (*IPFSDiscService) Start

func (disc *IPFSDiscService) Start()

type RoutingTable

type RoutingTable struct {
	// PeerID is the peer whose neighbors (routing table entries) are in the array below.
	PeerID peer.ID
	// The peers that are in the routing table of the above peer
	Neighbors []peer.AddrInfo
	// First error that has occurred during crawling that peer
	Error error
	// Little Endian representation of at which CPLs errors occurred during neighbors fetches.
	// errorBits tracks at which CPL errors have occurred.
	// 0000 0000 0000 0000 - No error
	// 0000 0000 0000 0001 - An error has occurred at CPL 0
	// 1000 0000 0000 0001 - An error has occurred at CPL 0 and 15
	ErrorBits uint16
}

RoutingTable captures the routing table information and crawl error of a particular peer

Jump to

Keyboard shortcuts

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