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

Commit a54bb83

Browse files
authored
feat: p2p addrs situation (#82)
* chore: update gitignore * chore: update CI configs * chore: update deps * chore: small refactor
1 parent ef45cc9 commit a54bb83

File tree

6 files changed

+38
-20
lines changed

6 files changed

+38
-20
lines changed

.gitignore

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
**/node_modules/
2+
**/*.log
3+
test/repo-tests*
4+
**/bundle.js
5+
16
# Logs
27
logs
38
*.log
49

10+
coverage
11+
512
# Runtime data
613
pids
714
*.pid
@@ -19,9 +26,17 @@ coverage
1926
# node-waf configuration
2027
.lock-wscript
2128

22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
23-
build/Release
29+
build
2430

2531
# Dependency directory
2632
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
2733
node_modules
34+
35+
lib
36+
dist
37+
test/test-data/go-ipfs-repo/LOCK
38+
test/test-data/go-ipfs-repo/LOG
39+
test/test-data/go-ipfs-repo/LOG.old
40+
41+
# while testing npm5
42+
package-lock.json

.travis.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
sudo: false
22
language: node_js
3+
34
matrix:
45
include:
5-
- node_js: 4
6-
env: CXX=g++-4.8
76
- node_js: 6
87
env: CXX=g++-4.8
9-
- node_js: stable
8+
- node_js: 8
109
env: CXX=g++-4.8
11-
12-
# Make sure we have new NPM.
13-
before_install:
14-
- npm install -g npm
10+
# - node_js: stable
11+
# env: CXX=g++-4.8
1512

1613
script:
1714
- npm run lint
18-
- npm test
15+
- npm run test
1916
- npm run coverage
17+
- make test
2018

2119
before_script:
2220
- export DISPLAY=:99.0
@@ -26,8 +24,9 @@ after_success:
2624
- npm run coverage-publish
2725

2826
addons:
27+
firefox: 'latest'
2928
apt:
3029
sources:
3130
- ubuntu-toolchain-r-test
3231
packages:
33-
- g++-4.8
32+
- g++-4.8

circle.yml

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

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
},
3131
"homepage": "https://github.com/libp2p/js-libp2p-tcp",
3232
"engines": {
33-
"node": ">=4.0.0"
33+
"node": ">=6.0.0",
34+
"npm": ">=3.0.0"
3435
},
3536
"devDependencies": {
3637
"aegir": "^11.0.2",
37-
"chai": "^4.1.0",
38+
"chai": "^4.1.2",
3839
"dirty-chai": "^2.0.1",
3940
"interface-transport": "~0.3.5",
4041
"lodash.isfunction": "^3.0.8",
@@ -46,8 +47,8 @@
4647
"ip-address": "^5.8.8",
4748
"lodash.includes": "^4.3.0",
4849
"lodash.isfunction": "^3.0.8",
49-
"mafmt": "^2.1.8",
50-
"multiaddr": "^2.3.0",
50+
"mafmt": "^3.0.0",
51+
"multiaddr": "^3.0.0",
5152
"once": "^1.4.0",
5253
"stream-to-pull-stream": "^1.7.2"
5354
},
@@ -61,4 +62,4 @@
6162
"Richard Littauer <[email protected]>",
6263
"Stephen Whitmore <[email protected]>"
6364
]
64-
}
65+
}

src/get-multiaddr.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const multiaddr = require('multiaddr')
44
const Address6 = require('ip-address').Address6
55

66
module.exports = (socket) => {
7-
var mh
7+
let mh
88

99
if (socket.remoteFamily === 'IPv6') {
1010
var addr = new Address6(socket.remoteAddress)

src/listener.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const getMultiaddr = require('./get-multiaddr')
1414

1515
const IPFS_CODE = 421
1616
const CLOSE_TIMEOUT = 2000
17+
1718
function noop () {}
1819

1920
module.exports = (handler) => {

0 commit comments

Comments
 (0)