mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-08 02:28:03 +00:00
feat: p2p addrs situation (#119)
* chore: update gitignore and CI * chore: update deps * test: update tests to use p2p-webrtc-star
This commit is contained in:
parent
19ce266f1b
commit
cad173e3bd
26
.gitignore
vendored
26
.gitignore
vendored
@ -1,10 +1,13 @@
|
|||||||
**/package-lock.json
|
**/node_modules/
|
||||||
**/node_modules
|
**/*.log
|
||||||
|
test/repo-tests*
|
||||||
|
**/bundle.js
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
npm-debug.log*
|
|
||||||
|
coverage
|
||||||
|
|
||||||
# Runtime data
|
# Runtime data
|
||||||
pids
|
pids
|
||||||
@ -23,16 +26,17 @@ coverage
|
|||||||
# node-waf configuration
|
# node-waf configuration
|
||||||
.lock-wscript
|
.lock-wscript
|
||||||
|
|
||||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
build
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directory
|
# Dependency directory
|
||||||
|
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
|
||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
# Optional npm cache directory
|
lib
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
dist
|
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
.travis.yml
14
.travis.yml
@ -1,22 +1,20 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- node_js: 4
|
|
||||||
env: CXX=g++-4.8
|
|
||||||
- node_js: 6
|
- node_js: 6
|
||||||
env: CXX=g++-4.8
|
env: CXX=g++-4.8
|
||||||
- node_js: stable
|
- node_js: 8
|
||||||
env: CXX=g++-4.8
|
env: CXX=g++-4.8
|
||||||
|
# - node_js: stable
|
||||||
# Make sure we have new NPM.
|
# env: CXX=g++-4.8
|
||||||
before_install:
|
|
||||||
- npm install -g npm@4
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm test
|
- npm run test
|
||||||
- npm run coverage
|
- npm run coverage
|
||||||
|
- make test
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- export DISPLAY=:99.0
|
- export DISPLAY=:99.0
|
||||||
|
@ -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/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="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/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>
|
<br>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
32
package.json
32
package.json
@ -23,7 +23,7 @@
|
|||||||
"IPFS"
|
"IPFS"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.0.0",
|
"node": ">=6.0.0",
|
||||||
"npm": ">=3.0.0"
|
"npm": ">=3.0.0"
|
||||||
},
|
},
|
||||||
"pre-commit": [
|
"pre-commit": [
|
||||||
@ -38,27 +38,27 @@
|
|||||||
"homepage": "https://github.com/libp2p/js-libp2p",
|
"homepage": "https://github.com/libp2p/js-libp2p",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "^2.5.0",
|
"async": "^2.5.0",
|
||||||
"libp2p-ping": "~0.5.0",
|
"libp2p-ping": "~0.6.0",
|
||||||
"libp2p-swarm": "~0.31.0",
|
"libp2p-swarm": "~0.32.0",
|
||||||
"mafmt": "^2.1.8",
|
"mafmt": "^3.0.0",
|
||||||
"multiaddr": "^2.3.0",
|
"multiaddr": "^3.0.0",
|
||||||
"peer-book": "~0.5.0",
|
"peer-book": "~0.5.0",
|
||||||
"peer-id": "~0.9.0",
|
"peer-id": "~0.10.0",
|
||||||
"peer-info": "~0.10.0"
|
"peer-info": "~0.11.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"aegir": "^11.0.2",
|
"aegir": "^11.0.2",
|
||||||
"chai": "^4.1.1",
|
"chai": "^4.1.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"cids": "~0.5.1",
|
"cids": "~0.5.1",
|
||||||
"libp2p-kad-dht": "~0.4.1",
|
"libp2p-kad-dht": "~0.5.0",
|
||||||
"libp2p-mdns": "~0.8.0",
|
"libp2p-mdns": "~0.9.0",
|
||||||
"libp2p-multiplex": "~0.4.4",
|
"libp2p-multiplex": "~0.5.0",
|
||||||
"libp2p-railing": "~0.6.1",
|
"libp2p-railing": "~0.7.0",
|
||||||
"libp2p-secio": "~0.7.1",
|
"libp2p-secio": "~0.8.0",
|
||||||
"libp2p-spdy": "~0.10.6",
|
"libp2p-spdy": "~0.11.0",
|
||||||
"libp2p-tcp": "~0.10.2",
|
"libp2p-tcp": "~0.11.0",
|
||||||
"libp2p-webrtc-star": "~0.12.0",
|
"libp2p-webrtc-star": "~0.13.0",
|
||||||
"libp2p-websockets": "~0.10.1",
|
"libp2p-websockets": "~0.10.1",
|
||||||
"lodash.times": "^4.3.2",
|
"lodash.times": "^4.3.2",
|
||||||
"pre-commit": "^1.2.2",
|
"pre-commit": "^1.2.2",
|
||||||
|
@ -25,11 +25,11 @@ describe('libp2p-ipfs-browser (webrtc only)', () => {
|
|||||||
expect(err).to.not.exist()
|
expect(err).to.not.exist()
|
||||||
|
|
||||||
peer1 = new PeerInfo(ids[0])
|
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)
|
peer1.multiaddrs.add(ma1)
|
||||||
|
|
||||||
peer2 = new PeerInfo(ids[1])
|
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)
|
peer2.multiaddrs.add(ma2)
|
||||||
|
|
||||||
done()
|
done()
|
||||||
@ -67,7 +67,7 @@ describe('libp2p-ipfs-browser (webrtc only)', () => {
|
|||||||
expect(Object.keys(peers2)).to.have.length(1)
|
expect(Object.keys(peers2)).to.have.length(1)
|
||||||
|
|
||||||
pull(
|
pull(
|
||||||
pull.values([Buffer(text)]),
|
pull.values([Buffer.from(text)]),
|
||||||
conn,
|
conn,
|
||||||
pull.collect((err, data) => {
|
pull.collect((err, data) => {
|
||||||
expect(err).to.not.exist()
|
expect(err).to.not.exist()
|
||||||
@ -108,7 +108,7 @@ describe('libp2p-ipfs-browser (webrtc only)', () => {
|
|||||||
expect(err).to.not.exist()
|
expect(err).to.not.exist()
|
||||||
|
|
||||||
const peer3 = new PeerInfo(id3)
|
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)
|
peer3.multiaddrs.add(ma3)
|
||||||
|
|
||||||
node1.on('peer:discovery', (peerInfo) => node1.dial(peerInfo, check))
|
node1.on('peer:discovery', (peerInfo) => node1.dial(peerInfo, check))
|
||||||
|
@ -29,7 +29,7 @@ describe('discovery', () => {
|
|||||||
},
|
},
|
||||||
(cb) => createNode([
|
(cb) => createNode([
|
||||||
'/ip4/0.0.0.0/tcp/0',
|
'/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) => {
|
], options, (err, node) => {
|
||||||
expect(err).to.not.exist()
|
expect(err).to.not.exist()
|
||||||
nodeA = node
|
nodeA = node
|
||||||
@ -38,7 +38,7 @@ describe('discovery', () => {
|
|||||||
}),
|
}),
|
||||||
(cb) => createNode([
|
(cb) => createNode([
|
||||||
'/ip4/0.0.0.0/tcp/0',
|
'/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) => {
|
], options, (err, node) => {
|
||||||
expect(err).to.not.exist()
|
expect(err).to.not.exist()
|
||||||
nodeB = node
|
nodeB = node
|
||||||
|
@ -34,7 +34,7 @@ describe('TCP + WebSockets + WebRTCStar', () => {
|
|||||||
createNode([
|
createNode([
|
||||||
'/ip4/0.0.0.0/tcp/0',
|
'/ip4/0.0.0.0/tcp/0',
|
||||||
'/ip4/127.0.0.1/tcp/25011/ws',
|
'/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: {
|
modules: {
|
||||||
transport: [wstar],
|
transport: [wstar],
|
||||||
@ -68,7 +68,7 @@ describe('TCP + WebSockets + WebRTCStar', () => {
|
|||||||
const wstar = new WStar({wrtc: wrtc})
|
const wstar = new WStar({wrtc: wrtc})
|
||||||
|
|
||||||
createNode([
|
createNode([
|
||||||
'/libp2p-webrtc-star/ip4/127.0.0.1/tcp/24642/ws'
|
'/ip4/127.0.0.1/tcp/24642/ws/p2p-webrtc-star'
|
||||||
], {
|
], {
|
||||||
modules: {
|
modules: {
|
||||||
transport: [wstar],
|
transport: [wstar],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user