This repository was archived by the owner on Apr 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 44
44
},
45
45
"dependencies" : {
46
46
"libp2p" : " ^0.5.1" ,
47
+ "libp2p-railing" : " ^0.4.0" ,
47
48
"libp2p-secio" : " ^0.6.5" ,
48
49
"libp2p-spdy" : " ^0.10.3" ,
49
50
"libp2p-swarm" : " ^0.26.13" ,
61
62
" Richard Littauer <richard.littauer@gmail.com>" ,
62
63
" greenkeeperio-bot <support@greenkeeper.io>"
63
64
]
64
- }
65
+ }
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ const WS = require('libp2p-websockets')
4
4
const WebRTCStar = require ( 'libp2p-webrtc-star' )
5
5
const spdy = require ( 'libp2p-spdy' )
6
6
const secio = require ( 'libp2p-secio' )
7
+ const Railing = require ( 'libp2p-railing' )
7
8
const libp2p = require ( 'libp2p' )
8
9
9
10
class Node extends libp2p {
10
11
constructor ( peerInfo , peerBook , options ) {
12
+ options = options || { }
11
13
const webRTCStar = new WebRTCStar ( )
12
14
13
15
const modules = {
@@ -27,6 +29,12 @@ class Node extends libp2p {
27
29
webRTCStar . discovery
28
30
]
29
31
}
32
+
33
+ if ( options . bootstrap && process . env . IPFS_BOOTSTRAP ) {
34
+ const r = new Railing ( options . bootstrap )
35
+ modules . discovery . push ( r )
36
+ }
37
+
30
38
super ( modules , peerInfo , peerBook , options )
31
39
}
32
40
}
You can’t perform that action at this time.
0 commit comments