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
By adding `circuitRelayTransport`with the `discoverRelays` option, js-libp2p was able to create circuit relay reservation (time and bandwidth-constrained) on the relay.
259
+
By adding a `circuitRelayTransport`and configuring a `/p2p-circuit` listen address, js-libp2p was able to create circuit relay reservation (time and bandwidth-constrained) on the relay.
258
260
259
261
### Testing circuit relay
260
262
@@ -275,16 +277,18 @@ Update the `src/index.js` file as follows, making sure to replace the multiaddr
275
277
+import { bootstrap } from '@libp2p/bootstrap'
276
278
277
279
const libp2p = await createLibp2p({
280
+
addresses: {
281
+
listen: [
282
+
'/p2p-circuit',
283
+
],
284
+
},
278
285
transports: [
279
-
// Allow all WebSocket connections inclusing without TLS
280
-
webSockets({ filter: filters.all }),
286
+
webSockets(),
281
287
webTransport(),
282
288
webRTC(),
283
-
circuitRelayTransport({
284
-
discoverRelays: 1,
285
-
}),
289
+
circuitRelayTransport(),
286
290
],
287
-
connectionEncryption: [noise()],
291
+
connectionEncrypters: [noise()],
288
292
streamMuxers: [yamux()],
289
293
connectionGater: {
290
294
// Allow private addresses for local testing
@@ -312,22 +316,20 @@ In the `src/index.js` file, update the call to `createLibp2p` as follows:
312
316
313
317
```diff
314
318
const libp2p = await createLibp2p({
315
-
+ addresses: {
316
-
+ listen: [
319
+
addresses: {
320
+
listen: [
321
+
'/p2p-circuit',
317
322
+ // 👇 Listen for webRTC connections
318
323
+ '/webrtc',
319
-
+ ],
320
-
+ },
324
+
],
325
+
},
321
326
transports: [
322
-
// Allow all WebSocket connections inclusing without TLS
323
-
webSockets({ filter: filters.all }),
327
+
webSockets(),
324
328
webTransport(),
325
329
webRTC(),
326
-
circuitRelayTransport({
327
-
discoverRelays: 1,
328
-
}),
330
+
circuitRelayTransport(),
329
331
],
330
-
connectionEncryption: [noise()],
332
+
connectionEncrypters: [noise()],
331
333
streamMuxers: [yamux()],
332
334
connectionGater: {
333
335
// Allow private addresses for local testing
@@ -393,20 +395,17 @@ In the `src/index.js` file, update the call to `createLibp2p` as follows:
393
395
const libp2p = await createLibp2p({
394
396
addresses: {
395
397
listen: [
396
-
// 👇 Listen for webRTC connections
398
+
'/p2p-circuit',
397
399
'/webrtc',
398
400
],
399
401
},
400
402
transports: [
401
-
// Allow all WebSocket connections inclusing without TLS
0 commit comments