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

Commit

Permalink
fix(docs): update webrtc instructions for node in faq (#3183)
Browse files Browse the repository at this point in the history
They were out of date and cause confusing errors to be thrown.
  • Loading branch information
achingbrain authored Jul 21, 2020
1 parent 93adb1f commit 8f5a19f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/ipfs/docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,10 @@ To add WebRTC support in a IPFS node instance, do:

```JavaScript
const wrtc = require('wrtc') // or require('electron-webrtc')()
const WStar = require('libp2p-webrtc-star')
const wstar = new WStar({ wrtc })
const WebRTCStar = require('libp2p-webrtc-star')

const node = await IPFS.create({
repo: 'your-repo-path',
// start: false,
config: {
Addresses: {
Swarm: [
Expand All @@ -88,8 +86,19 @@ const node = await IPFS.create({
},
libp2p: {
modules: {
transport: [wstar],
peerDiscovery: [wstar.discovery]
transport: [WebRTCStar]
},
config: {
peerDiscovery: {
[WebRTCStar.tag]: {
enabled: true
}
},
transport: {
WebRTCStar: {
wrtc
}
}
}
}
})
Expand Down

0 comments on commit 8f5a19f

Please sign in to comment.