mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-03 16:21:04 +00:00
test: use that crypto puzzle! (#135)
This commit is contained in:
parent
ec956c1d42
commit
f602cd9f79
@ -17,7 +17,10 @@ let node
|
|||||||
const before = (done) => {
|
const before = (done) => {
|
||||||
parallel([
|
parallel([
|
||||||
(cb) => {
|
(cb) => {
|
||||||
sigServer.start({ port: 15555 }, (err, server) => {
|
sigServer.start({
|
||||||
|
port: 15555
|
||||||
|
// cryptoChallenge: true TODO: needs https://github.com/libp2p/js-libp2p-webrtc-star/issues/128
|
||||||
|
}, (err, server) => {
|
||||||
if (err) { return cb(err) }
|
if (err) { return cb(err) }
|
||||||
wrtcRendezvous = server
|
wrtcRendezvous = server
|
||||||
cb()
|
cb()
|
||||||
@ -28,7 +31,7 @@ const before = (done) => {
|
|||||||
port: 14444,
|
port: 14444,
|
||||||
refreshPeerListIntervalMS: 1000,
|
refreshPeerListIntervalMS: 1000,
|
||||||
strictMultiaddr: false,
|
strictMultiaddr: false,
|
||||||
cryptoChallenge: false
|
cryptoChallenge: true
|
||||||
}, (err, _server) => {
|
}, (err, _server) => {
|
||||||
if (err) { return cb(err) }
|
if (err) { return cb(err) }
|
||||||
wsRendezvous = _server
|
wsRendezvous = _server
|
||||||
|
10
package.json
10
package.json
@ -42,9 +42,9 @@
|
|||||||
"libp2p-swarm": "~0.33.2",
|
"libp2p-swarm": "~0.33.2",
|
||||||
"mafmt": "^3.0.2",
|
"mafmt": "^3.0.2",
|
||||||
"multiaddr": "^3.0.1",
|
"multiaddr": "^3.0.1",
|
||||||
"peer-book": "~0.5.1",
|
"peer-book": "~0.5.2",
|
||||||
"peer-id": "~0.10.2",
|
"peer-id": "~0.10.3",
|
||||||
"peer-info": "~0.11.1"
|
"peer-info": "~0.11.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"aegir": "^12.2.0",
|
"aegir": "^12.2.0",
|
||||||
@ -60,9 +60,9 @@
|
|||||||
"libp2p-secio": "~0.8.1",
|
"libp2p-secio": "~0.8.1",
|
||||||
"libp2p-spdy": "~0.11.0",
|
"libp2p-spdy": "~0.11.0",
|
||||||
"libp2p-tcp": "~0.11.1",
|
"libp2p-tcp": "~0.11.1",
|
||||||
"libp2p-webrtc-star": "~0.13.2",
|
"libp2p-webrtc-star": "~0.13.3",
|
||||||
"libp2p-websockets": "~0.10.4",
|
"libp2p-websockets": "~0.10.4",
|
||||||
"libp2p-websocket-star": "~0.5.1",
|
"libp2p-websocket-star": "~0.7.1",
|
||||||
"libp2p-websocket-star-rendezvous": "~0.2.1",
|
"libp2p-websocket-star-rendezvous": "~0.2.1",
|
||||||
"lodash.times": "^4.3.2",
|
"lodash.times": "^4.3.2",
|
||||||
"pre-commit": "^1.2.2",
|
"pre-commit": "^1.2.2",
|
||||||
|
@ -36,13 +36,13 @@ function getMuxers (options) {
|
|||||||
class Node extends libp2p {
|
class Node extends libp2p {
|
||||||
constructor (peerInfo, peerBook, options) {
|
constructor (peerInfo, peerBook, options) {
|
||||||
options = options || {}
|
options = options || {}
|
||||||
const webRTCStar = new WebRTCStar()
|
const wrtcStar = new WebRTCStar({ id: peerInfo.id })
|
||||||
const wsStar = new WebSocketStar()
|
const wsStar = new WebSocketStar({ id: peerInfo.id })
|
||||||
|
|
||||||
const modules = {
|
const modules = {
|
||||||
transport: [
|
transport: [
|
||||||
new WS(),
|
new WS(),
|
||||||
webRTCStar,
|
wrtcStar,
|
||||||
wsStar
|
wsStar
|
||||||
],
|
],
|
||||||
connection: {
|
connection: {
|
||||||
@ -55,7 +55,7 @@ class Node extends libp2p {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.webRTCStar) {
|
if (options.webRTCStar) {
|
||||||
modules.discovery.push(webRTCStar.discovery)
|
modules.discovery.push(wrtcStar.discovery)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.wsStar) {
|
if (options.wsStar) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user