Skip to content

Commit a0f305c

Browse files
chore: apply suggestions from code review
Co-authored-by: Jacob Heun <[email protected]>
1 parent a09ac4a commit a0f305c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/auto-relay/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ While direct connections to nodes are preferable, it's not always possible to do
77

88
Before moving into the examples, you should run `npm install` on the top level `js-libp2p` folder, in order to install all the dependencies needed for this example.
99

10-
This example comes with 3 main files. A `relay.js` file to be used in the first step, a `auto-relay.js` file to be used in the second step and a `other-node.js` file to be used on the third step. All of this scripts will run their own libp2p node, which will interact with the previous ones. This way, you need to have all of them running as you proceed.
10+
This example comes with 3 main files. A `relay.js` file to be used in the first step, a `auto-relay.js` file to be used in the second step and a `other-node.js` file to be used on the third step. All of these scripts will run their own libp2p node, which will interact with the previous ones. All nodes must be running in order for you to proceed.
1111

1212
## 1. Set up a relay node
1313

14-
Aiming to support nodes with connectivity issues, you will need to set up a relay node for the former nodes to bind.
14+
In the first step of this example, we need to configure and run a relay node in order for our target node to bind to for accepting inbound connections.
1515

1616
The relay node will need to have its relay subsystem enabled, as well as its HOP capability. It can be configured as follows:
1717

@@ -74,7 +74,7 @@ TODO: Docker Image with a repo
7474

7575
## 2. Set up a node with Auto Relay Enabled
7676

77-
One of the typical use cases for Auto Relay is nodes behind a NAT or browser nodes thanks to their limitations regarding listening for new connections. For running a libp2p node that automatically binds itself to connected HOP relays, you can see the following:
77+
One of the typical use cases for Auto Relay is nodes behind a NAT or browser nodes due to their inability to expose a public address. For running a libp2p node that automatically binds itself to connected HOP relays, you can see the following:
7878

7979
```js
8080
const Libp2p = require('libp2p')
@@ -111,17 +111,17 @@ console.log(`Node started: ${node.peerId.toB58String()}`)
111111

112112
await node.dial(relayAddr)
113113

114-
// Wait for connection and relay to be bind for the example purpose
114+
// Wait for connection and relay to bind for the purpose of this example
115115
await pWaitFor(() => node.multiaddrs.length > 0)
116116

117117
console.log('connected to the HOP relay')
118118
console.log('Listening on:')
119119
node.multiaddrs.forEach((ma) => console.log(`${ma.toString()}/p2p/${node.peerId.toB58String()}`))
120120
```
121121

122-
As you can see in the code, we need to provide the `relayAddr` as a process argument. This node will dial the relay and automatically bind to the relay.
122+
As you can see in the code, we need to provide the relay address, `relayAddr`, as a process argument. This node will dial the provided relay address and automatically bind to it.
123123

124-
You should now run the following to start the relay node:
124+
You should now run the following to start the node running Auto Relay:
125125

126126
```sh
127127
node auto-relay.js /ip4/192.168.1.120/tcp/58941/ws/p2p/QmQKCBm87HQMbFqy14oqC85pMmnRrj6iD46ggM6reqNpsd

0 commit comments

Comments
 (0)