hs-libp2p-0.2.0.0: Haskell implementation of the libp2p networking stack
Safe HaskellNone
LanguageGHC2021

LibP2P.NAT.AutoNAT.Service

Description

Background AutoNAT v1 reachability probing.

The client only probes peers that already have a direct connection. It never dials a peer merely to ask for a dial-back, bounds each request with a timeout, probes one peer at a time, and throttles repeated requests to the same peer.

Synopsis

Documentation

data AutoNATClientConfig Source #

AutoNAT client scheduling and resource bounds.

Constructors

AutoNATClientConfig 

Fields

defaultAutoNATClientConfig :: AutoNATClientConfig Source #

go-libp2p scheduling defaults, with four peers per cycle to satisfy the AutoNAT v1 requirement for more than three agreeing dial reports.

data AutoNATClientService Source #

Handle for observing and stopping the background client.

startAutoNATClient :: Switch -> AutoNATClientConfig -> IO AutoNATClientService Source #

Start periodic reachability probing and attach its lifetime to the Switch.

autoNATClientStatus :: AutoNATClientService -> IO NATStatus Source #

Read the most recently aggregated reachability status.

stopAutoNATClient :: AutoNATClientService -> IO () Source #

Stop the client and cancel any in-flight request.