Skip to content

Commit 1a716dc

Browse files
authored
docs: update autonat v2 readme (#3198)
Fixes typos and updates example
1 parent d2dc12c commit 1a716dc

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

packages/protocol-autonat-v2/README.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# @libp2p/autonat
2-
31
# @libp2p/autonat-v2
42

53
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
64
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
75
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p)
86
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p/main.yml?branch=main\&style=flat-square)](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amain)
97

10-
> Implementation of the Autonat Protocol v2
8+
> Implementation of the AutoNAT Protocol v2
119
1210
# About
1311

@@ -26,31 +24,22 @@ repo and examine the changes made.
2624
2725
-->
2826

29-
The AutoNAT service uses the [AutoNAT protocol](https://docs.libp2p.io/concepts/nat/autonat/).
30-
The service confirms addresses are dialable by remote peers, and updates the list it advertises.
31-
32-
The service dials randomly selected peers with a request to verify it's external addresses.
33-
The request includes a list of public multiaddrs (addressManager.getObservedAddrs()).
34-
The remote peers dial that list and respond with the results.
35-
36-
The AutoNAT service uses those responses to either:
37-
38-
- addressManager.confirmObservedAddr(addr)
39-
- addressManager.removeObservedAddr(addr)
27+
The AutoNATv2 service implements the [AutoNAT v2 protocol](https://github.com/libp2p/specs/blob/master/autonat/autonat-v2.md)
28+
to confirm whether addresses the node is listening on are dialable by remote
29+
peers.
4030

41-
The result list of candidates and confirmed addresses can be found
42-
at addressManager.getObservedAddrs()
31+
It does not implement NAT hole punching.
4332

4433
## Example
4534

4635
```typescript
4736
import { createLibp2p } from 'libp2p'
48-
import { autoNAT } from '@libp2p/autonat'
37+
import { autoNATv2 } from '@libp2p/autonat-v2'
4938

5039
const node = await createLibp2p({
5140
// ...other options
5241
services: {
53-
autoNAT: autoNAT()
42+
autoNAT: autoNATv2()
5443
}
5544
})
5645
```

packages/protocol-autonat-v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@libp2p/autonat-v2",
33
"version": "0.0.0",
4-
"description": "Implementation of the Autonat Protocol v2",
4+
"description": "Implementation of the AutoNAT Protocol v2",
55
"license": "Apache-2.0 OR MIT",
66
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/protocol-autonat-v2#readme",
77
"repository": {

0 commit comments

Comments
 (0)