Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 8f5a19f

Browse files
authored
fix(docs): update webrtc instructions for node in faq (#3183)
They were out of date and cause confusing errors to be thrown.
1 parent 93adb1f commit 8f5a19f

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

packages/ipfs/docs/FAQ.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ To add WebRTC support in a IPFS node instance, do:
7171

7272
```JavaScript
7373
const wrtc = require('wrtc') // or require('electron-webrtc')()
74-
const WStar = require('libp2p-webrtc-star')
75-
const wstar = new WStar({ wrtc })
74+
const WebRTCStar = require('libp2p-webrtc-star')
7675

7776
const node = await IPFS.create({
7877
repo: 'your-repo-path',
79-
// start: false,
8078
config: {
8179
Addresses: {
8280
Swarm: [
@@ -88,8 +86,19 @@ const node = await IPFS.create({
8886
},
8987
libp2p: {
9088
modules: {
91-
transport: [wstar],
92-
peerDiscovery: [wstar.discovery]
89+
transport: [WebRTCStar]
90+
},
91+
config: {
92+
peerDiscovery: {
93+
[WebRTCStar.tag]: {
94+
enabled: true
95+
}
96+
},
97+
transport: {
98+
WebRTCStar: {
99+
wrtc
100+
}
101+
}
93102
}
94103
}
95104
})

0 commit comments

Comments
 (0)