From 1c7085e2bc466f5d0bd44e9c1f172ce517a9c56a Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Thu, 3 Jan 2019 16:29:47 +0000 Subject: [PATCH 1/7] chore: update deps License: MIT Signed-off-by: Alan Shaw --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7a4c204881..e0969951f0 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ }, "homepage": "https://github.com/ipfs/js-ipfs#readme", "devDependencies": { - "aegir": "^17.0.1", + "aegir": "^18.0.2", "chai": "^4.2.0", "delay": "^4.1.0", "detect-node": "^2.0.4", @@ -71,7 +71,7 @@ "execa": "^1.0.0", "form-data": "^2.3.3", "hat": "0.0.3", - "interface-ipfs-core": "~0.92.0", + "interface-ipfs-core": "~0.94.0", "ipfsd-ctl": "~0.40.1", "ncp": "^2.0.0", "qs": "^6.5.2", @@ -130,7 +130,7 @@ "joi-multiaddr": "^3.0.0", "libp2p": "~0.24.1", "libp2p-bootstrap": "~0.9.3", - "libp2p-crypto": "~0.14.1", + "libp2p-crypto": "~0.15.0", "libp2p-kad-dht": "~0.12.1", "libp2p-keychain": "~0.3.3", "libp2p-mdns": "~0.12.0", @@ -169,11 +169,11 @@ "pull-stream-to-stream": "^1.3.4", "pump": "^3.0.0", "read-pkg-up": "^4.0.0", - "readable-stream": "3.0.6", + "readable-stream": "^3.1.1", "receptacle": "^1.3.2", "stream-to-pull-stream": "^1.7.2", "tar-stream": "^1.6.2", - "temp": "~0.8.3", + "temp": "~0.9.0", "update-notifier": "^2.5.0", "varint": "^5.0.0", "yargs": "^12.0.5", From 84b70f11a6aa2b6262b330832857af2f86a4e8ec Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Fri, 4 Jan 2019 13:12:21 +0000 Subject: [PATCH 2/7] chore: update deps License: MIT Signed-off-by: Alan Shaw --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e0969951f0..7a427d1716 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ }, "homepage": "https://github.com/ipfs/js-ipfs#readme", "devDependencies": { - "aegir": "^18.0.2", + "aegir": "^17.1.1", "chai": "^4.2.0", "delay": "^4.1.0", "detect-node": "^2.0.4", @@ -71,7 +71,7 @@ "execa": "^1.0.0", "form-data": "^2.3.3", "hat": "0.0.3", - "interface-ipfs-core": "~0.94.0", + "interface-ipfs-core": "~0.95.0", "ipfsd-ctl": "~0.40.1", "ncp": "^2.0.0", "qs": "^6.5.2", @@ -131,12 +131,12 @@ "libp2p": "~0.24.1", "libp2p-bootstrap": "~0.9.3", "libp2p-crypto": "~0.15.0", - "libp2p-kad-dht": "~0.12.1", + "libp2p-kad-dht": "~0.14.2", "libp2p-keychain": "~0.3.3", "libp2p-mdns": "~0.12.0", "libp2p-mplex": "~0.8.4", "libp2p-record": "~0.6.1", - "libp2p-secio": "~0.10.1", + "libp2p-secio": "~0.11.0", "libp2p-tcp": "~0.13.0", "libp2p-webrtc-star": "~0.15.5", "libp2p-websocket-star": "~0.10.0", From 3bb748038ce2c347949b4d9d5c2242da1cd02766 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Fri, 4 Jan 2019 17:42:50 +0000 Subject: [PATCH 3/7] chore: update joi-multiaddr dependency License: MIT Signed-off-by: Alan Shaw --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a427d1716..4e1b8991b5 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "is-stream": "^1.1.0", "joi": "^14.3.0", "joi-browser": "^13.4.0", - "joi-multiaddr": "^3.0.0", + "joi-multiaddr": "^4.0.0", "libp2p": "~0.24.1", "libp2p-bootstrap": "~0.9.3", "libp2p-crypto": "~0.15.0", From 8d29a5b0ab2019c050b9109da7b7198389f00f17 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Mon, 14 Jan 2019 15:50:46 +0000 Subject: [PATCH 4/7] chore: update more deps License: MIT Signed-off-by: Alan Shaw --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 4e1b8991b5..69d2d8fa06 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "execa": "^1.0.0", "form-data": "^2.3.3", "hat": "0.0.3", - "interface-ipfs-core": "~0.95.0", + "interface-ipfs-core": "~0.96.0", "ipfsd-ctl": "~0.40.1", "ncp": "^2.0.0", "qs": "^6.5.2", @@ -108,7 +108,7 @@ "ipfs-bitswap": "~0.21.0", "ipfs-block": "~0.8.0", "ipfs-block-service": "~0.15.1", - "ipfs-http-client": "^28.1.0", + "ipfs-http-client": "^28.1.2", "ipfs-http-response": "~0.2.1", "ipfs-mfs": "~0.8.0", "ipfs-multipart": "~0.1.0", @@ -130,8 +130,8 @@ "joi-multiaddr": "^4.0.0", "libp2p": "~0.24.1", "libp2p-bootstrap": "~0.9.3", - "libp2p-crypto": "~0.15.0", - "libp2p-kad-dht": "~0.14.2", + "libp2p-crypto": "~0.16.0", + "libp2p-kad-dht": "~0.14.4", "libp2p-keychain": "~0.3.3", "libp2p-mdns": "~0.12.0", "libp2p-mplex": "~0.8.4", From 60dc0db47ff151436345785d39d7d6ccb8236d18 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Mon, 14 Jan 2019 15:51:17 +0000 Subject: [PATCH 5/7] fix: eventemitter memory leak warning License: MIT Signed-off-by: Alan Shaw --- src/core/components/libp2p.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/core/components/libp2p.js b/src/core/components/libp2p.js index c5e3a40b1c..f4bcf6da37 100644 --- a/src/core/components/libp2p.js +++ b/src/core/components/libp2p.js @@ -87,15 +87,23 @@ module.exports = function libp2p (self) { peerBook: self._peerInfoBook }) + let discoveredPeers = [] + + const putAndDial = peerInfo => { + self._peerInfoBook.put(peerInfo) + self._libp2pNode.dial(peerInfo, () => {}) + } + + self._libp2pNode.on('start', () => { + discoveredPeers.forEach(putAndDial) + discoveredPeers = [] + }) + self._libp2pNode.on('peer:discovery', (peerInfo) => { - const dial = () => { - self._peerInfoBook.put(peerInfo) - self._libp2pNode.dial(peerInfo, () => {}) - } if (self.isOnline()) { - dial() + putAndDial(peerInfo) } else { - self._libp2pNode.once('start', dial) + discoveredPeers.push(peerInfo) } }) From 046836fc54578807a604b943c36fda93c3d7ed37 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Tue, 15 Jan 2019 09:52:29 +0000 Subject: [PATCH 6/7] refactor: switch to bignumber.js License: MIT Signed-off-by: Alan Shaw --- package.json | 10 +++++----- src/core/components/bitswap.js | 2 +- src/core/components/stats.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 69d2d8fa06..c26f7c37f4 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "dependencies": { "@nodeutils/defaults-deep": "^1.1.0", "async": "^2.6.1", - "big.js": "^5.2.2", + "bignumber.js": "^8.0.2", "binary-querystring": "~0.1.2", "bl": "^2.1.2", "boom": "^7.2.0", @@ -105,14 +105,14 @@ "hoek": "^6.1.2", "human-to-milliseconds": "^1.0.0", "interface-datastore": "~0.6.0", - "ipfs-bitswap": "~0.21.0", + "ipfs-bitswap": "~0.22.0", "ipfs-block": "~0.8.0", "ipfs-block-service": "~0.15.1", - "ipfs-http-client": "^28.1.2", + "ipfs-http-client": "ipfs/js-ipfs-http-client#refactor/bignumber", "ipfs-http-response": "~0.2.1", "ipfs-mfs": "~0.8.0", "ipfs-multipart": "~0.1.0", - "ipfs-repo": "~0.26.0", + "ipfs-repo": "github:ipfs/js-ipfs-repo#refactor/bignumber", "ipfs-unixfs": "~0.1.16", "ipfs-unixfs-engine": "~0.35.3", "ipld": "~0.20.1", @@ -121,7 +121,7 @@ "ipld-ethereum": "^2.0.1", "ipld-git": "~0.2.2", "ipld-zcash": "~0.1.6", - "ipns": "~0.4.3", + "ipns": "~0.5.0", "is-ipfs": "~0.4.8", "is-pull-stream": "~0.0.0", "is-stream": "^1.1.0", diff --git a/src/core/components/bitswap.js b/src/core/components/bitswap.js index 930ab88e2d..13787534aa 100644 --- a/src/core/components/bitswap.js +++ b/src/core/components/bitswap.js @@ -3,7 +3,7 @@ const OFFLINE_ERROR = require('../utils').OFFLINE_ERROR const promisify = require('promisify-es6') const setImmediate = require('async/setImmediate') -const Big = require('big.js') +const Big = require('bignumber.js') const CID = require('cids') const PeerId = require('peer-id') const errCode = require('err-code') diff --git a/src/core/components/stats.js b/src/core/components/stats.js index f67c2c8cd1..0e64d38925 100644 --- a/src/core/components/stats.js +++ b/src/core/components/stats.js @@ -1,7 +1,7 @@ 'use strict' const promisify = require('promisify-es6') -const Big = require('big.js') +const Big = require('bignumber.js') const Pushable = require('pull-pushable') const human = require('human-to-milliseconds') const toStream = require('pull-stream-to-stream') From 37e3d3b0b62f9f0c1d28058e89201e9447c2a54d Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Tue, 15 Jan 2019 10:24:44 +0000 Subject: [PATCH 7/7] chore: update dependencies License: MIT Signed-off-by: Alan Shaw --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c26f7c37f4..757af33d02 100644 --- a/package.json +++ b/package.json @@ -108,11 +108,11 @@ "ipfs-bitswap": "~0.22.0", "ipfs-block": "~0.8.0", "ipfs-block-service": "~0.15.1", - "ipfs-http-client": "ipfs/js-ipfs-http-client#refactor/bignumber", + "ipfs-http-client": "^29.0.0", "ipfs-http-response": "~0.2.1", "ipfs-mfs": "~0.8.0", "ipfs-multipart": "~0.1.0", - "ipfs-repo": "github:ipfs/js-ipfs-repo#refactor/bignumber", + "ipfs-repo": "~0.26.1", "ipfs-unixfs": "~0.1.16", "ipfs-unixfs-engine": "~0.35.3", "ipld": "~0.20.1",