Skip to content
This repository was archived by the owner on Aug 23, 2019. It is now read-only.

feat: p2p addrs situation #229

Merged
merged 3 commits into from
Sep 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
**/package-lock.json
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js

# Logs
logs
*.log

coverage

# Runtime data
pids
*.pid
Expand All @@ -21,14 +26,17 @@ coverage
# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
build

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules


coverage

lib
dist
test/test-data/go-ipfs-repo/LOCK
test/test-data/go-ipfs-repo/LOG
test/test-data/go-ipfs-repo/LOG.old

# while testing npm5
package-lock.json
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ language: node_js

matrix:
include:
- node_js: 4
env: CXX=g++-4.8
- node_js: 6
env: CXX=g++-4.8
- node_js: stable
- node_js: 8
env: CXX=g++-4.8

# Make sure we have new NPM.
before_install:
- npm install -g npm@4
# - node_js: stable
# env: CXX=g++-4.8

script:
- npm run lint
- npm test
- npm run test
- npm run coverage
- make test

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ libp2p-swarm JavaScript implementation
[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-swarm.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-swarm)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)
![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square)
![](https://img.shields.io/badge/Node.js-%3E%3D6.0.0-orange.svg?style=flat-square)

> libp2p swarm implementation in JavaScript.

Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@
"test"
],
"engines": {
"node": ">=4.0.0",
"node": ">=6.0.0",
"npm": ">=3.0.0"
},
"devDependencies": {
"aegir": "^11.0.2",
"buffer-loader": "0.0.1",
"chai": "^4.1.1",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"gulp": "^3.9.1",
"libp2p-multiplex": "~0.4.4",
"libp2p-multiplex": "~0.5.0",
"libp2p-secio": "~0.7.1",
"libp2p-spdy": "~0.10.6",
"libp2p-tcp": "~0.10.2",
"libp2p-webrtc-star": "~0.12.0",
"libp2p-spdy": "~0.11.0",
"libp2p-tcp": "~0.11.0",
"libp2p-webrtc-star": "~0.13.0",
"libp2p-websockets": "~0.10.1",
"pre-commit": "^1.2.2",
"pull-goodbye": "0.0.2",
Expand All @@ -62,13 +62,13 @@
"debug": "^3.0.1",
"interface-connection": "~0.3.2",
"ip-address": "^5.8.8",
"libp2p-identify": "~0.5.0",
"libp2p-identify": "~0.6.0",
"lodash.includes": "^4.3.0",
"multiaddr": "^2.3.0",
"multiaddr": "^3.0.0",
"multistream-select": "~0.13.5",
"once": "^1.4.0",
"peer-id": "~0.9.0",
"peer-info": "~0.10.0",
"peer-id": "~0.10.0",
"peer-info": "~0.11.0",
"protocol-buffers": "^3.2.1",
"pull-stream": "^3.6.0"
},
Expand All @@ -89,4 +89,4 @@
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>",
"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <victorbjelkholm@gmail.com>"
]
}
}
6 changes: 3 additions & 3 deletions test/browser-swarm-with-muxing-plus-webrtc-star.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ describe('high level API (swarm with spdy + webrtc-star)', () => {
(cb) => peerId.create((err, id1) => {
expect(err).to.not.exist()
peer1 = new PeerInfo(id1)
const mh1 = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/' +
const mh1 = 'ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' +
id1.toB58String()
peer1.multiaddrs.add(mh1)
cb()
}),
(cb) => peerId.create((err, id2) => {
expect(err).to.not.exist()
peer2 = new PeerInfo(id2)
const mh2 = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/' +
const mh2 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' +
id2.toB58String()
peer2.multiaddrs.add(mh2)
cb()
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('high level API (swarm with spdy + webrtc-star)', () => {
expect(err).to.not.exist()

const peer3 = new PeerInfo(id3)
const mh3 = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/' + id3.toB58String()
const mh3 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + id3.toB58String()
peer3.multiaddrs.add(mh3)

swarm3 = new Swarm(peer3, new PeerBook())
Expand Down
7 changes: 4 additions & 3 deletions test/browser-transport-webrtc-star.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ describe('transport - webrtc-star', () => {
before(() => {
const id1 = peerId.createFromB58String('QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooooA')
peer1 = new PeerInfo(id1)
const mh1 = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooooA'
const mh1 = 'ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooooA'
peer1.multiaddrs.add(mh1)

const id2 = peerId.createFromB58String('QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooooB')
peer2 = new PeerInfo(id2)
const mh2 = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooooB'
const mh2 = 'ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooooB'
peer2.multiaddrs.add(mh2)

swarm1 = new Swarm(peer1, new PeerBook())
Expand Down Expand Up @@ -76,7 +76,8 @@ describe('transport - webrtc-star', () => {
})
it('dial offline / non-existent node', (done) => {
peer2.multiaddrs.clear()
peer2.multiaddrs.add('/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/ABCD')
peer2.multiaddrs.add('/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/ABCD')

swarm1.transport.dial('wstar', peer2, (err, conn) => {
expect(err).to.exist()
expect(conn).to.not.exist()
Expand Down