Skip to content

Commit

Permalink
feat: p2p addrs situation (#119)
Browse files Browse the repository at this point in the history
* chore: update gitignore and CI

* chore: update deps

* test: update tests to use p2p-webrtc-star
  • Loading branch information
daviddias authored Sep 3, 2017
1 parent 19ce266 commit cad173e
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 44 deletions.
26 changes: 15 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
**/package-lock.json
**/node_modules
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js

# Logs
logs
*.log
npm-debug.log*

coverage

# Runtime data
pids
Expand All @@ -23,16 +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

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

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
14 changes: 6 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
sudo: false
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

before_script:
- export DISPLAY=:99.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a href="https://github.com/feross/standard"><img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square"></a>
<a href="https://github.com/RichardLitt/standard-readme"><img src="https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square" /></a>
<a href=""><img src="https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square" /></a>
<a href=""><img src="https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square" /></a>
<a href=""><img src="https://img.shields.io/badge/Node.js-%3E%3D6.0.0-orange.svg?style=flat-square" /></a>
<br>
</p>

Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"IPFS"
],
"engines": {
"node": ">=4.0.0",
"node": ">=6.0.0",
"npm": ">=3.0.0"
},
"pre-commit": [
Expand All @@ -38,27 +38,27 @@
"homepage": "https://github.com/libp2p/js-libp2p",
"dependencies": {
"async": "^2.5.0",
"libp2p-ping": "~0.5.0",
"libp2p-swarm": "~0.31.0",
"mafmt": "^2.1.8",
"multiaddr": "^2.3.0",
"libp2p-ping": "~0.6.0",
"libp2p-swarm": "~0.32.0",
"mafmt": "^3.0.0",
"multiaddr": "^3.0.0",
"peer-book": "~0.5.0",
"peer-id": "~0.9.0",
"peer-info": "~0.10.0"
"peer-id": "~0.10.0",
"peer-info": "~0.11.0"
},
"devDependencies": {
"aegir": "^11.0.2",
"chai": "^4.1.1",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"cids": "~0.5.1",
"libp2p-kad-dht": "~0.4.1",
"libp2p-mdns": "~0.8.0",
"libp2p-multiplex": "~0.4.4",
"libp2p-railing": "~0.6.1",
"libp2p-secio": "~0.7.1",
"libp2p-spdy": "~0.10.6",
"libp2p-tcp": "~0.10.2",
"libp2p-webrtc-star": "~0.12.0",
"libp2p-kad-dht": "~0.5.0",
"libp2p-mdns": "~0.9.0",
"libp2p-multiplex": "~0.5.0",
"libp2p-railing": "~0.7.0",
"libp2p-secio": "~0.8.0",
"libp2p-spdy": "~0.11.0",
"libp2p-tcp": "~0.11.0",
"libp2p-webrtc-star": "~0.13.0",
"libp2p-websockets": "~0.10.1",
"lodash.times": "^4.3.2",
"pre-commit": "^1.2.2",
Expand Down
8 changes: 4 additions & 4 deletions test/browser-bundle/webrtc-star-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ describe('libp2p-ipfs-browser (webrtc only)', () => {
expect(err).to.not.exist()

peer1 = new PeerInfo(ids[0])
const ma1 = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/' + ids[0].toB58String()
const ma1 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + ids[0].toB58String()
peer1.multiaddrs.add(ma1)

peer2 = new PeerInfo(ids[1])
const ma2 = '/libp2p-webrtc-star/ip4/127.0.0.1/tcp/15555/ws/ipfs/' + ids[1].toB58String()
const ma2 = '/ip4/127.0.0.1/tcp/15555/ws/p2p-webrtc-star/ipfs/' + ids[1].toB58String()
peer2.multiaddrs.add(ma2)

done()
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('libp2p-ipfs-browser (webrtc only)', () => {
expect(Object.keys(peers2)).to.have.length(1)

pull(
pull.values([Buffer(text)]),
pull.values([Buffer.from(text)]),
conn,
pull.collect((err, data) => {
expect(err).to.not.exist()
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('libp2p-ipfs-browser (webrtc only)', () => {
expect(err).to.not.exist()

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

node1.on('peer:discovery', (peerInfo) => node1.dial(peerInfo, check))
Expand Down
4 changes: 2 additions & 2 deletions test/nodejs-bundle/discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('discovery', () => {
},
(cb) => createNode([
'/ip4/0.0.0.0/tcp/0',
`/libp2p-webrtc-star/ip4/127.0.0.1/tcp/${port}/ws`
`/ip4/127.0.0.1/tcp/${port}/ws/p2p-webrtc-star`
], options, (err, node) => {
expect(err).to.not.exist()
nodeA = node
Expand All @@ -38,7 +38,7 @@ describe('discovery', () => {
}),
(cb) => createNode([
'/ip4/0.0.0.0/tcp/0',
`/libp2p-webrtc-star/ip4/127.0.0.1/tcp/${port}/ws`
`/ip4/127.0.0.1/tcp/${port}/ws/p2p-webrtc-star`
], options, (err, node) => {
expect(err).to.not.exist()
nodeB = node
Expand Down
4 changes: 2 additions & 2 deletions test/nodejs-bundle/tcp+websockets+webrtc-star.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('TCP + WebSockets + WebRTCStar', () => {
createNode([
'/ip4/0.0.0.0/tcp/0',
'/ip4/127.0.0.1/tcp/25011/ws',
'/libp2p-webrtc-star/ip4/127.0.0.1/tcp/24642/ws'
'/ip4/127.0.0.1/tcp/24642/ws/p2p-webrtc-star'
], {
modules: {
transport: [wstar],
Expand Down Expand Up @@ -68,7 +68,7 @@ describe('TCP + WebSockets + WebRTCStar', () => {
const wstar = new WStar({wrtc: wrtc})

createNode([
'/libp2p-webrtc-star/ip4/127.0.0.1/tcp/24642/ws'
'/ip4/127.0.0.1/tcp/24642/ws/p2p-webrtc-star'
], {
modules: {
transport: [wstar],
Expand Down

0 comments on commit cad173e

Please sign in to comment.