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.
If a node is configured with this address, it will use the specified host (`/ip4/127.0.0.1/tcp/65000/ipfs/QmRelay`) as a relay and it will be reachable over this relay. There could multiple addresses of this sort specified in the config, in which case the node is going to be reachable over all of them. This is useful if for example, the node is behind a firewall but wants to be reachable from the outside over a specific relay.
81
+
If a node is configured with this address, it will use the specified host (`/ip4/127.0.0.1/tcp/65000/ipfs/QmRelay`) as a relay and it will be reachable over this relay.
82
+
- There could multiple addresses of this sort specified in the config, in which case the node is going to be reachable over all of them.
83
+
- This is useful if for example, the node is behind a firewall but wants to be reachable from the outside over a specific relay.
82
84
83
-
Other use-cases are also supported by this scheme, i.e. we can have multiple hops (circuit-relay nodes) encoded in the address, something planed for future releases.
85
+
Other use-cases are also supported by this scheme, e.g. we can have multiple hops (circuit-relay nodes) encoded in the address, something planed for future releases.
84
86
85
87
## Step-by-step instructions
86
88
87
89
Here's what we are going to be doing, today:
88
90
89
-
-1. Install and configure `go-ipfs` and `js-ipfs` nodes
90
-
-2. Configure and run the js or go ipfs node
91
-
-3. Configure and run the bundled example
92
-
-4. Connect the two browser nodes to the circuit relay
93
-
-5. Dial the two browser nodes using a `/p2p-circuit` address
94
-
-6. Finally, send data from one browser using the bundled example!
91
+
1. Install and configure `go-ipfs` and `js-ipfs` nodes
92
+
2. Configure and run the js or go ipfs node
93
+
3. Configure and run the bundled example
94
+
4. Connect the two browser nodes to the circuit relay
95
+
5. Dial the two browser nodes using a `/p2p-circuit` address
96
+
6. Finally, send data from one browser using the bundled example!
95
97
96
98
> We should end up with something similar to the bellow screenshot after we've gone through all the steps:
97
99
@@ -129,7 +131,7 @@ This will set up your IPFS repo in your home directory.
129
131
130
132
#### Configure and run the js or go ipfs node
131
133
132
-
We can either use a `go-ipfs` or a `js-ipfs` node as a relay, we'll demonstrate how to set them up in this tutorial and we encourage you to try them both out. That said, either js or go should do the trick for the purpose of this tutorial!
134
+
We can either use a `go-ipfs` or a `js-ipfs` node as a relay, we'll demonstrate how to set them up in this tutorial and we encourage you to try them both out. That said, either js or go should do the trick!
133
135
134
136
##### Setting up a `go-ipfs` node
135
137
@@ -190,7 +192,7 @@ Note that we don't have to do anything to enable the `websocket` transport as it
190
192
191
193
We can start the relay nodes by either doing `ipfs daemon` or `jsipfs daemon`:
192
194
193
-
> go ipfs
195
+
**go ipfs**
194
196
195
197
```
196
198
$ ipfs daemon
@@ -229,7 +231,7 @@ $ ipfs id
229
231
230
232
We can then grab the resolved multiaddr from the `Addresses` array - `/ip4/127.0.0.1/tcp/4004/ws/ipfs/Qm...`. Lets note it down somewhere and move to the next step.
231
233
232
-
> js ipfs
234
+
**js ipfs**
233
235
234
236
```
235
237
$ jsipfs daemon
@@ -247,7 +249,7 @@ Daemon is ready
247
249
248
250
Look out for an address similar to `/ip4/127.0.0.1/tcp/4003/ws/ipfs/Qm...` note it down somewhere, and lets move on to the next step.
249
251
250
-
### Configure and run the bundled example
252
+
### 2. Configure and run the bundled example
251
253
252
254
Now that we have ipfs installed and initialized, lets set up the included example. This is a standard npm package, so the usual `npm install` should get us going. Lets `cd` into the `examples/circuit-relaying` directory and run:
253
255
@@ -266,21 +268,23 @@ The bundled example is a simple chat app that uses another cool ipfs feature - [
266
268
267
269

268
270
269
-
### Connect the two browser nodes to the circuit relay
271
+
### 3. Connect the two browser nodes to the circuit relay
270
272
271
-
In order for our browser nodes to be able to send messages to each other, we need to first get them connected, but for that we need to use the relay, remember, browser nodes can't be dialed directly because of lack of socket support, so the relay is here to solve that.
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.
272
274
273
-
Enter the `/ip4/127.0.0.1/tcp/4003/ws/ipfs/...` address noted above into the `Connect to Peer` field and hit the connect button:
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
+
277
+
Having both browsers running side by side (as shown in the first screenshot), enter the `/ip4/127.0.0.1/tcp/4003/ws/ipfs/...` address noted above into the `Connect to Peer` field and hit the `Connect` button:
274
278
275
279

276
280
277
-
After connecting to the IPFS node, we should see the peer show up under the `Peers Connected` box.
281
+
After connecting to the IPFS node, we should see the relay peer show up under the `Peers Connected` box.
278
282
279
283

280
284
281
-
Now lets repeat the same steps with the second tab. After that, both of our browser nodes should be connected and we can move on to the next step.
285
+
Lets repeat the same steps with the second tab. Now, both of our browser nodes should be connected to the relay and we can move on to the next step.
282
286
283
-
### Dial the two browser nodes using a `/p2p-circuit` address
287
+
### 4. Dial the two browser nodes using a `/p2p-circuit` address
284
288
285
289
Having both browsers running side by side (as shown in the first screenshot), lets 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.
286
290
@@ -290,7 +294,7 @@ Lets hit the `Connect` button on each of the tabs and we should get the two brow
290
294
291
295

292
296
293
-
### Send data browser to browser.
297
+
### 5. Send data browser to browser.
294
298
295
299
Now that we have the two browsers connected, lets try the app out. Type a few words in one of the browser windows and you should see them appear in the other as well!
0 commit comments