Categorygithub.com/libp2p/go-libp2p-discovery
modulepackage
0.7.0
Repository: https://github.com/libp2p/go-libp2p-discovery.git
Documentation: pkg.go.dev

# README

DEPRECATION NOTICE

This package has moved into go-libp2p, split into multiple sub-packages: github.com/libp2p/go-libp2p/p2p/discovery.

go-libp2p-discovery

Discourse posts

Interfaces for active peer discovery

This package contains interfaces and utilities for active peer discovery. Peers providing a service use the interface to advertise their presence in some namespace. Vice versa, peers seeking a service use the interface to discover peers that have previously advertised as service providers. The package also includes a baseline implementation for discovery through Content Routing.

Documenation

See https://godoc.org/github.com/libp2p/go-libp2p-discovery.

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT


The last gx published version of this module was: 1.0.15: QmWA8k8apx6egshEjemkuxpKNJS7W7heCgzTnBhAvX9yoB

# Functions

Advertise is a utility function that persistently advertises a service through an Advertiser.
FindPeers is a utility function that synchronously collects peers from a Discoverer.
FullJitter returns a random number uniformly chose from the range [min, boundedDur].
NewBackoffConnector creates a utility to connect to peers, but only if we have not recently tried connecting to them already cacheSize is the size of a TwoQueueCache connectionTryDuration is how long we attempt to connect to a peer before giving up backoff describes the strategy used to decide how long to backoff after previously attempting to connect to a peer Deprecated: use go-libp2p/p2p/discovery/backoff.NewBackoffConnector instead.
Deprecated: use go-libp2p/p2p/discovery/backoff.NewBackoffDiscovery instead.
Deprecated: use go-libp2p/p2p/discovery/routing.NewDiscoveryRouting instead.
NewExponentialBackoff creates a BackoffFactory with backoff of the form base^x + offset where x is the attempt number jitter is the function for adding randomness around the backoff timeUnits are the units of time the base^x is evaluated in Deprecated: use go-libp2p/p2p/discovery/backoff.NewExponentialBackoff instead.
NewExponentialDecorrelatedJitter creates a BackoffFactory with backoff of the roughly of the form base^x where x is the attempt number.
NewFixedBackoff creates a BackoffFactory with a constant backoff duration Deprecated: use go-libp2p/p2p/discovery/backoff.NewFixedBackoff instead.
NewPolynomialBackoff creates a BackoffFactory with backoff of the form c0*x^0, c1*x^1, ...cn*x^n where x is the attempt number jitter is the function for adding randomness around the backoff timeUnits are the units of time the polynomial is evaluated in polyCoefs is the array of polynomial coefficients from [c0, c1, ..
Deprecated: use go-libp2p/p2p/discovery/routing.NewRoutingDiscovery instead.
NoJitter returns the duration bounded between min and max Deprecated: use go-libp2p/p2p/discovery/backoff.NoJitter instead.
WithBackoffDiscoveryReturnedChannelSize sets the size of the buffer to be used during a FindPeer query.
WithBackoffDiscoverySimultaneousQueryBufferSize sets the buffer size for the channels between the main FindPeers query for a given namespace and all simultaneous FindPeers queries for the namespace Deprecated: use go-libp2p/p2p/discovery/backoff.WithBackoffDiscoverySimultaneousQueryBufferSize instead.

# Type aliases

BackoffConnector is a utility to connect to peers, but only if we have not recently tried connecting to them already Deprecated: use go-libp2p/p2p/discovery/backoff.BackoffConnector inste.
BackoffDiscovery is an implementation of discovery that caches peer data and attenuates repeated queries Deprecated: use go-libp2p/p2p/discovery/backoff.BackoffDiscovery instead.
Deprecated: use go-libp2p/p2p/discovery/backoff.BackoffDiscoveryOption instead.
Deprecated: use go-libp2p/p2p/discovery/backoff.BackoffFactory instead.
BackoffStrategy describes how backoff will be implemented.
Deprecated: use go-libp2p/p2p/discovery/routing.RoutingDiscovery instead.
Jitter must return a duration between min and max.
RoutingDiscovery is an implementation of discovery using ContentRouting.