This repository was archived by the owner on Aug 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Async Crypto Endeavour #108
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3456969
test: update to async peerid
dignifiedquire c5f908f
update to latest
dignifiedquire 8ef5736
refactor: replace run-* with async
dignifiedquire 2671fee
cr - round1
dignifiedquire 604a12e
ready for next aegir
dignifiedquire 8d556b9
update aegir
dignifiedquire 9a3fe5c
ready
dignifiedquire b964f9e
chore: update of the deps
daviddias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,3 @@ node_modules | |
coverage | ||
|
||
dist | ||
lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,8 @@ | |
"name": "libp2p-swarm", | ||
"version": "0.23.0", | ||
"description": "libp2p swarm implementation in JavaScript", | ||
"main": "lib/index.js", | ||
"jsnext:main": "src/index.js", | ||
"scripts": { | ||
"main": "src/index.js", | ||
"scripts": { | ||
"lint": "gulp lint", | ||
"build": "gulp build", | ||
"test": "gulp test", | ||
|
@@ -34,10 +33,10 @@ | |
"test" | ||
], | ||
"engines": { | ||
"node": "^4.3.0" | ||
"node": ">=4.0.0" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^8.0.0", | ||
"aegir": "^9.0.0", | ||
"buffer-loader": "0.0.1", | ||
"chai": "^3.5.0", | ||
"gulp": "^3.9.1", | ||
|
@@ -53,20 +52,18 @@ | |
"webrtcsupport": "^2.2.0" | ||
}, | ||
"dependencies": { | ||
"babel-runtime": "^6.11.6", | ||
"async": "^2.0.1", | ||
"browserify-zlib": "github:ipfs/browserify-zlib", | ||
"debug": "^2.2.0", | ||
"interface-connection": "^0.2.1", | ||
"ip-address": "^5.8.2", | ||
"libp2p-identify": "^0.2.0", | ||
"lodash.includes": "^4.3.0", | ||
"multiaddr": "^2.0.2", | ||
"multistream-select": "^0.11.0", | ||
"multiaddr": "^2.0.3", | ||
"multistream-select": "^0.11.1", | ||
"peer-id": "^0.7.0", | ||
"peer-info": "^0.7.1", | ||
"protocol-buffers": "^3.1.6", | ||
"run-parallel": "^1.1.6", | ||
"run-waterfall": "^1.1.3" | ||
"protocol-buffers": "^3.1.6" | ||
}, | ||
"contributors": [ | ||
"David Dias <[email protected]>", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,48 @@ | ||
/* eslint-env mocha */ | ||
|
||
'use strict' | ||
|
||
const expect = require('chai').expect | ||
const parallel = require('run-parallel') | ||
const parallel = require('async/parallel') | ||
const multiaddr = require('multiaddr') | ||
const Peer = require('peer-info') | ||
const TCP = require('libp2p-tcp') | ||
const pull = require('pull-stream') | ||
|
||
const utils = require('./utils') | ||
const Swarm = require('../src') | ||
|
||
describe('transport - tcp', function () { | ||
let swarmA | ||
let swarmB | ||
let peerA = new Peer() | ||
let peerB = new Peer() | ||
|
||
before(() => { | ||
peerA.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9888')) | ||
peerB.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9999')) | ||
swarmA = new Swarm(peerA) | ||
swarmB = new Swarm(peerB) | ||
let peerA | ||
let peerB | ||
|
||
before((done) => { | ||
utils.createInfos(2, (err, infos) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems you already went ahead and did what I proposed above. Would you like to make it a module? |
||
if (err) { | ||
return done(err) | ||
} | ||
peerA = infos[0] | ||
peerB = infos[1] | ||
|
||
peerA.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9888')) | ||
peerB.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9999')) | ||
swarmA = new Swarm(peerA) | ||
swarmB = new Swarm(peerB) | ||
done() | ||
}) | ||
}) | ||
|
||
let peer | ||
beforeEach((done) => { | ||
Peer.create((err, info) => { | ||
if (err) { | ||
return done(err) | ||
} | ||
|
||
peer = info | ||
done() | ||
}) | ||
}) | ||
|
||
it('add', (done) => { | ||
|
@@ -99,7 +120,6 @@ describe('transport - tcp', function () { | |
|
||
it('support port 0', (done) => { | ||
let swarm | ||
let peer = new Peer() | ||
peer.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/0')) | ||
swarm = new Swarm(peer) | ||
swarm.transport.add('tcp', new TCP()) | ||
|
@@ -116,7 +136,6 @@ describe('transport - tcp', function () { | |
|
||
it('support addr /ip4/0.0.0.0/tcp/9050', (done) => { | ||
let swarm | ||
let peer = new Peer() | ||
peer.multiaddr.add(multiaddr('/ip4/0.0.0.0/tcp/9050')) | ||
swarm = new Swarm(peer) | ||
swarm.transport.add('tcp', new TCP()) | ||
|
@@ -137,7 +156,6 @@ describe('transport - tcp', function () { | |
|
||
it('support addr /ip4/0.0.0.0/tcp/0', (done) => { | ||
let swarm | ||
let peer = new Peer() | ||
peer.multiaddr.add(multiaddr('/ip4/0.0.0.0/tcp/0')) | ||
swarm = new Swarm(peer) | ||
swarm.transport.add('tcp', new TCP()) | ||
|
@@ -154,7 +172,6 @@ describe('transport - tcp', function () { | |
|
||
it('listen in several addrs', (done) => { | ||
let swarm | ||
let peer = new Peer() | ||
peer.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9001')) | ||
peer.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9002')) | ||
peer.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/9003')) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be super beneficial to have a libp2p module
libp2p-peer-gen
that already has 100 or 1000 PeerId generated and so, each time we request 'one peer', it would be super fast because it only had to load it from disk. We would use this everywhere for testing!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛎