feat: p2p addrs situation (#82)

* chore: update gitignore

* chore: update CI configs

* chore: update deps

* chore: small refactor
This commit is contained in:
David Dias 2017-09-03 10:01:16 +01:00 committed by GitHub
parent ef45cc9a34
commit a54bb83657
6 changed files with 38 additions and 20 deletions

19
.gitignore vendored
View File

@ -1,7 +1,14 @@
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js
# Logs # Logs
logs logs
*.log *.log
coverage
# Runtime data # Runtime data
pids pids
*.pid *.pid
@ -19,9 +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 # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules node_modules
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

View File

@ -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
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
@ -26,8 +24,9 @@ after_success:
- npm run coverage-publish - npm run coverage-publish
addons: addons:
firefox: 'latest'
apt: apt:
sources: sources:
- ubuntu-toolchain-r-test - ubuntu-toolchain-r-test
packages: packages:
- g++-4.8 - g++-4.8

View File

@ -5,8 +5,10 @@ machine:
dependencies: dependencies:
pre: pre:
- google-chrome --version - google-chrome --version
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' - sudo dpkg -i google-chrome.deb || true
- sudo apt-get update - sudo apt-get update
- sudo apt-get --only-upgrade install google-chrome-stable - sudo apt-get install -f
- sudo apt-get install --only-upgrade lsb-base
- sudo dpkg -i google-chrome.deb
- google-chrome --version - google-chrome --version

View File

@ -30,11 +30,12 @@
}, },
"homepage": "https://github.com/libp2p/js-libp2p-tcp", "homepage": "https://github.com/libp2p/js-libp2p-tcp",
"engines": { "engines": {
"node": ">=4.0.0" "node": ">=6.0.0",
"npm": ">=3.0.0"
}, },
"devDependencies": { "devDependencies": {
"aegir": "^11.0.2", "aegir": "^11.0.2",
"chai": "^4.1.0", "chai": "^4.1.2",
"dirty-chai": "^2.0.1", "dirty-chai": "^2.0.1",
"interface-transport": "~0.3.5", "interface-transport": "~0.3.5",
"lodash.isfunction": "^3.0.8", "lodash.isfunction": "^3.0.8",
@ -46,8 +47,8 @@
"ip-address": "^5.8.8", "ip-address": "^5.8.8",
"lodash.includes": "^4.3.0", "lodash.includes": "^4.3.0",
"lodash.isfunction": "^3.0.8", "lodash.isfunction": "^3.0.8",
"mafmt": "^2.1.8", "mafmt": "^3.0.0",
"multiaddr": "^2.3.0", "multiaddr": "^3.0.0",
"once": "^1.4.0", "once": "^1.4.0",
"stream-to-pull-stream": "^1.7.2" "stream-to-pull-stream": "^1.7.2"
}, },
@ -61,4 +62,4 @@
"Richard Littauer <richard.littauer@gmail.com>", "Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>" "Stephen Whitmore <stephen.whitmore@gmail.com>"
] ]
} }

View File

@ -4,7 +4,7 @@ const multiaddr = require('multiaddr')
const Address6 = require('ip-address').Address6 const Address6 = require('ip-address').Address6
module.exports = (socket) => { module.exports = (socket) => {
var mh let mh
if (socket.remoteFamily === 'IPv6') { if (socket.remoteFamily === 'IPv6') {
var addr = new Address6(socket.remoteAddress) var addr = new Address6(socket.remoteAddress)

View File

@ -14,6 +14,7 @@ const getMultiaddr = require('./get-multiaddr')
const IPFS_CODE = 421 const IPFS_CODE = 421
const CLOSE_TIMEOUT = 2000 const CLOSE_TIMEOUT = 2000
function noop () {} function noop () {}
module.exports = (handler) => { module.exports = (handler) => {