File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -71,12 +71,10 @@ To add WebRTC support in a IPFS node instance, do:
7171
7272``` JavaScript
7373const 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
7776const 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})
You can’t perform that action at this time.
0 commit comments