test: use that crypto puzzle! (#135)

This commit is contained in:
David Dias 2017-12-01 09:19:44 +00:00 committed by GitHub
parent ec956c1d42
commit f602cd9f79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 11 deletions

View File

@ -17,7 +17,10 @@ let node
const before = (done) => {
parallel([
(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) }
wrtcRendezvous = server
cb()
@ -28,7 +31,7 @@ const before = (done) => {
port: 14444,
refreshPeerListIntervalMS: 1000,
strictMultiaddr: false,
cryptoChallenge: false
cryptoChallenge: true
}, (err, _server) => {
if (err) { return cb(err) }
wsRendezvous = _server

View File

@ -42,9 +42,9 @@
"libp2p-swarm": "~0.33.2",
"mafmt": "^3.0.2",
"multiaddr": "^3.0.1",
"peer-book": "~0.5.1",
"peer-id": "~0.10.2",
"peer-info": "~0.11.1"
"peer-book": "~0.5.2",
"peer-id": "~0.10.3",
"peer-info": "~0.11.3"
},
"devDependencies": {
"aegir": "^12.2.0",
@ -60,9 +60,9 @@
"libp2p-secio": "~0.8.1",
"libp2p-spdy": "~0.11.0",
"libp2p-tcp": "~0.11.1",
"libp2p-webrtc-star": "~0.13.2",
"libp2p-webrtc-star": "~0.13.3",
"libp2p-websockets": "~0.10.4",
"libp2p-websocket-star": "~0.5.1",
"libp2p-websocket-star": "~0.7.1",
"libp2p-websocket-star-rendezvous": "~0.2.1",
"lodash.times": "^4.3.2",
"pre-commit": "^1.2.2",

View File

@ -36,13 +36,13 @@ function getMuxers (options) {
class Node extends libp2p {
constructor (peerInfo, peerBook, options) {
options = options || {}
const webRTCStar = new WebRTCStar()
const wsStar = new WebSocketStar()
const wrtcStar = new WebRTCStar({ id: peerInfo.id })
const wsStar = new WebSocketStar({ id: peerInfo.id })
const modules = {
transport: [
new WS(),
webRTCStar,
wrtcStar,
wsStar
],
connection: {
@ -55,7 +55,7 @@ class Node extends libp2p {
}
if (options.webRTCStar) {
modules.discovery.push(webRTCStar.discovery)
modules.discovery.push(wrtcStar.discovery)
}
if (options.wsStar) {