This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 6868 "detect-node" : " ^2.0.3" ,
6969 "dir-compare" : " ^1.4.0" ,
7070 "dirty-chai" : " ^2.0.1" ,
71- "eslint-plugin-react" : " ^7.2.1 " ,
71+ "eslint-plugin-react" : " ^7.3.0 " ,
7272 "execa" : " ^0.8.0" ,
7373 "expose-loader" : " ^0.7.3" ,
74- "form-data" : " ^2.2.0 " ,
74+ "form-data" : " ^2.3.1 " ,
7575 "gulp" : " ^3.9.1" ,
7676 "interface-ipfs-core" : " ~0.30.1" ,
7777 "ipfsd-ctl" : " ~0.21.0" ,
9393 "bl" : " ^1.2.1" ,
9494 "boom" : " ^5.2.0" ,
9595 "cids" : " ^0.5.1" ,
96- "debug" : " ^3.0.0 " ,
96+ "debug" : " ^3.0.1 " ,
9797 "fsm-event" : " ^2.1.0" ,
9898 "glob" : " ^7.1.2" ,
9999 "hapi" : " ^16.5.2" ,
100100 "hapi-set-header" : " ^1.0.2" ,
101101 "hoek" : " ^4.2.0" ,
102102 "ipfs-api" : " ^14.1.2" ,
103- "ipfs-bitswap" : " ~0.15 .0" ,
103+ "ipfs-bitswap" : " ~0.16 .0" ,
104104 "ipfs-block" : " ~0.6.0" ,
105105 "ipfs-block-service" : " ~0.12.0" ,
106106 "ipfs-multipart" : " ~0.1.0" ,
118118 "libp2p-multiplex" : " ^0.4.4" ,
119119 "libp2p-railing" : " ^0.6.1" ,
120120 "libp2p-secio" : " ^0.7.1" ,
121- "libp2p-swarm" : " ^0.31.0 " ,
121+ "libp2p-swarm" : " ^0.31.2 " ,
122122 "libp2p-tcp" : " ^0.10.2" ,
123123 "libp2p-webrtc-star" : " ^0.12.0" ,
124124 "libp2p-websockets" : " ^0.10.1" ,
129129 "mafmt" : " ^2.1.8" ,
130130 "mkdirp" : " ^0.5.1" ,
131131 "multiaddr" : " ^2.3.0" ,
132- "multihashes" : " ~0.4.5 " ,
132+ "multihashes" : " ~0.4.8 " ,
133133 "once" : " ^1.4.0" ,
134134 "path-exists" : " ^3.0.0" ,
135135 "peer-book" : " ^0.5.0" ,
Original file line number Diff line number Diff line change @@ -5,20 +5,25 @@ const WebRTCStar = require('libp2p-webrtc-star')
55const Multiplex = require ( 'libp2p-multiplex' )
66const SECIO = require ( 'libp2p-secio' )
77const Railing = require ( 'libp2p-railing' )
8+ const KadDHT = require ( 'libp2p-kad-dht' )
89const libp2p = require ( 'libp2p' )
910
1011class Node extends libp2p {
1112 constructor ( peerInfo , peerBook , options ) {
1213 options = options || { }
13- const wstar = new WebRTCStar ( )
14+ const wStar = new WebRTCStar ( )
1415
1516 const modules = {
16- transport : [ new WS ( ) , wstar ] ,
17+ transport : [ new WS ( ) , wStar ] ,
1718 connection : {
1819 muxer : [ Multiplex ] ,
1920 crypto : [ SECIO ]
2021 } ,
21- discovery : [ wstar . discovery ]
22+ discovery : [ wStar . discovery ]
23+ }
24+
25+ if ( options . dht ) {
26+ modules . DHT = KadDHT
2227 }
2328
2429 if ( options . bootstrap ) {
You can’t perform that action at this time.
0 commit comments