You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: examples/circuit-relaying/README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -270,7 +270,7 @@ The bundled example is a simple chat app that uses another cool ipfs feature - [
270
270
271
271
### 3. Connect the two browser nodes to the circuit relay
272
272
273
-
In order for our browser nodes to be able to messages each other, we need to get them connected. But do do that, we need to use a relay - browser nodes can't be connected directly because of lack of socket support.
273
+
In order for our browser nodes to be able to messages each other, we need to get them connected. But to do that, we need to use a relay - browser nodes can't be connected directly because of lack of socket support.
274
274
275
275
Remember the caveat above `Currently a Relay will only work if it already has a connection to the STOP node`? This means that we need to connect our browser nodes to the relay node first.
276
276
@@ -286,7 +286,7 @@ Let's repeat the same steps with the second tab. Now, both of our browser nodes
286
286
287
287
### 4. Dial the two browser nodes using a `/p2p-circuit` address
288
288
289
-
Now that both browsers are running side by side (as shown in the first screenshot), let's get them connected to each other. Head out to the `Addresses` box in one of the tabs, copy the `/p2p-circuit` address and then paste it into the `Connect to Peer` box in the other tab. Repeat these steps on the second tab.
289
+
Now that our browsers are both connected to the relay peer, let's get them connected to each other. Head out to the `Addresses` box in one of the tabs, copy the `/p2p-circuit` address and then paste it into the `Connect to Peer` box in the other tab. Repeat these steps on the second tab.
290
290
291
291

292
292
@@ -329,7 +329,7 @@ const ipfs = new IPFS({
329
329
330
330
- We connected the browser nodes to an external node over its websocket transport using the `/ip4/127.0.0.1/tcp/4003/ws/ipfs/...` multiaddr. That external node happens to be a `HOP` node, meaning that it can relay connections for our browsers (and other nodes) allowing them to connect
331
331
332
-
- And finally we connected the two browser nodes using the `/p2p-circuit/ipfs/...` multiaddr. Take a look at the code below in [src/app.js](src/app.js), lines 102-107
332
+
- And finally we connected the two browser nodes using the `/p2p-circuit/ipfs/...` multiaddr. Take a look at the code below in [src/app.js](src/app.js#L102...L107) - lines 102-107
333
333
334
334
```js
335
335
ipfs.swarm.connect(peer, (err) => {
@@ -340,7 +340,7 @@ const ipfs = new IPFS({
340
340
})
341
341
```
342
342
343
-
Notice how there wasn't anything special we had to do to use the circuit once we had everything connected, all the magic is in the multiaddr! Multiaddrs are **AWESOME**!
343
+
The above code snippet, handles connecting to other nodes using `ipfs.swarm.connect`, notice how there wasn't anything special we had to do to use the circuit once we had everything connected, all the magic is in the multiaddr! [Multiaddrs](https://multiformats.io/multiaddr/) are **AWESOME**!
344
344
345
345
I encourage the reader to take a look at the bundled app code to see how the browser nodes get setup, suffice to say nothing changes from the perspective of using an `IPFS` node in js code, apart from the new `EXPERIMENTAL` options.
0 commit comments