Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
fix: update for new crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Sep 26, 2016
1 parent c80b9c8 commit 888bc7d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 44 deletions.
19 changes: 0 additions & 19 deletions .aegir.js

This file was deleted.

32 changes: 18 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,29 @@ let sigS

let node
const rawPeer = require('./test/peer.json')
const id = Id.createFromPrivKey(rawPeer.privKey)

gulp.task('libnode:start', (done) => {
const mh = multiaddr('/ip4/127.0.0.1/tcp/9200/ws')
const peer = new Peer(id)
peer.multiaddr.add(mh)

node = new Node(peer)
node.start(() => {
node.handle('/echo/1.0.0', (conn) => {
pull(conn, conn)
Id.createFromPrivKey(rawPeer.privKey, (err, id) => {
if (err) {
return done(err)
}

const peer = new Peer(id)
peer.multiaddr.add(mh)

node = new Node(peer)
node.start(() => {
node.handle('/echo/1.0.0', (conn) => {
pull(conn, conn)
})
ready()
})
ready()
})

let count = 0
const ready = () => ++count === 2 ? done() : null
let count = 0
const ready = () => ++count === 2 ? done() : null

sigS = sigServer.start(15555, ready)
sigS = sigServer.start(15555, ready)
})
})

gulp.task('libnode:stop', (done) => {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"test"
],
"scripts": {
"test": "gulp test",
"lint": "aegir-lint",
"test": "PHANTOM=off gulp test",
"test:node": "gulp test:node",
"test:browser": "gulp test:browser",
"test:browser": "PHANTOM=off gulp test:browser",
"build": "gulp build",
"release": "gulp release",
"release-minor": "gulp release --type minor",
"release-major": "gulp release --type major",
"release": "PHANTOM=off gulp release",
"release-minor": "PHANTOM=off gulp release --type minor",
"release-major": "PHANTOM=off gulp release --type major",
"coverage": "gulp coverage",
"coverage-publish": "aegir-coverage publish"
},
Expand Down Expand Up @@ -62,4 +62,4 @@
"Richard Littauer <richard.littauer@gmail.com>",
"greenkeeperio-bot <support@greenkeeper.io>"
]
}
}
15 changes: 10 additions & 5 deletions test/websockets-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ const serializer = require('pull-serializer')

const libp2p = require('../src')
const rawPeer = require('./peer.json')
const id = PeerId.createFromPrivKey(rawPeer.privKey)

describe('libp2p-ipfs-browser (websockets only)', function () {
describe('libp2p-ipfs-browser (websockets only)', () => {
let peerB
let nodeA

before((done) => {
const mh = multiaddr('/ip4/127.0.0.1/tcp/9200/ws/ipfs/' + rawPeer.id)
peerB = new PeerInfo(id)
peerB.multiaddr.add(mh)
done()
PeerId.createFromPrivKey(rawPeer.privKey, (err, id) => {
if (err) {
return done(err)
}

peerB = new PeerInfo(id)
peerB.multiaddr.add(mh)
done()
})
})

after((done) => {
Expand Down

0 comments on commit 888bc7d

Please sign in to comment.