Documentation ¶
Index ¶
- Constants
- func Discover(ctx context.Context, host host.Host, dht *dht.IpfsDHT, protocol protocol.ID)
- func GetBootNodesMultiAddress(bootstrapNodes []string) ([]multiaddr.Multiaddr, error)
- func GetMultiAddressesForHost(host host.Host) ([]multiaddr.Multiaddr, error)
- func GetMultiAddressesForHostQuiet(host host.Host) []multiaddr.Multiaddr
- func GetPriorityAddress(addrs []multiaddr.Multiaddr) multiaddr.Multiaddr
- func WithDht(ctx context.Context, host host.Host, bootstrapNodes []multiaddr.Multiaddr, ...) (*dht.IpfsDHT, error)
- func WithMDNS(host host.Host, rendezvous string, peerChan chan PeerEvent) error
- type PeerEvent
Constants ¶
View Source
const ( PeerAdded = "PeerAdded" PeerRemoved = "PeerRemoved" )
View Source
const PeerFound = "PeerFound"
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
Discover searches for and connects to peers that support the given protocol ID. It initializes discovery via the DHT and advertises this node. It runs discovery in a loop with a ticker, re-advertising and finding new peers. For each discovered peer, it checks if already connected, and if not, dials them.
func GetPriorityAddress ¶
func GetPriorityAddress(addrs []multiaddr.Multiaddr) multiaddr.Multiaddr
Types ¶
Click to show internal directories.
Click to hide internal directories.