Skip to content

Commit

Permalink
docs(autonat): Add documentation on where to get results of service
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Cole committed Mar 27, 2024
1 parent 43572a9 commit 3ece253
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/protocol-autonat/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
/**
* @packageDocumentation
*
* Use the `autoNATService` function to add support for the [AutoNAT protocol](https://docs.libp2p.io/concepts/nat/autonat/)
* to libp2p.
* The AutoNAT service uses the [AutoNAT protocol](https://docs.libp2p.io/concepts/nat/autonat/).
*
* The service dials randomly selected peers with a request to verify it's external addresses.
* The request includes a list of public multiaddrs (addressManager.getObservedAddrs()).
* The remote peers dial that list and respond with the results.
*
* The AutoNAT service uses those responses to either:
* - addressManager.confirmObservedAddr(addr)
* - addressManager.removeObservedAddr(addr)
*
* The list of candidates and confirmed addresses can be found at addressManager.getObservedAddrs()
*
* @example
*
Expand Down

0 comments on commit 3ece253

Please sign in to comment.