From 00958a75c4d0905e66135221956a19bdc297b63c Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 15:26:51 +1300 Subject: [PATCH 01/25] feat: use api/v0/shutdown to stop a deamon --- package.json | 2 +- src/ipfsd-daemon.js | 30 +++++++++++++++++------------- test/api.spec.js | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index dc2fa8f8..1af0f6b2 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "detect-port": "^1.2.2", "dirty-chai": "^2.0.1", "go-ipfs-dep": "0.4.13", - "ipfs": "^0.27.5", + "ipfs": "github:ipfs/js-ipfs", "is-running": "1.0.5", "mkdirp": "^0.5.1", "pre-commit": "^1.2.2", diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index e19895a2..98a26350 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -270,36 +270,40 @@ class Daemon { /** * Kill the `ipfs daemon` process. * - * First `SIGTERM` is sent, after 10.5 seconds `SIGKILL` is sent - * if the process hasn't exited yet. + * If the HTTP API is established, then send 'shutdown' command; otherwise, + * process.kill(`SIGTERM`) is used. In either case, if the process + * does not exit after 10.5 seconds then a `SIGKILL` is used. * * @param {function()} callback - Called when the process was killed. * @returns {undefined} */ killProcess (callback) { // need a local var for the closure, as we clear the var. + const self = this const subprocess = this.subprocess const timeout = setTimeout(() => { log('kill timeout, using SIGKILL', subprocess.pid) subprocess.kill('SIGKILL') - callback() }, GRACE_PERIOD) - const disposable = this.disposable - const clean = this.cleanup.bind(this) - subprocess.once('close', () => { + subprocess.once('exit', () => { log('killed', subprocess.pid) clearTimeout(timeout) - this.subprocess = null - this._started = false - if (disposable) { - return clean(callback) + self.subprocess = null + self._started = false + if (self.disposable) { + return self.cleanup(callback) } - callback() + setImmediate(callback) }) - log('killing', subprocess.pid) - subprocess.kill('SIGTERM') + if (this.api) { + log('kill via api', subprocess.pid) + this.api.shutdown(() => null) + } else { + log('killing', subprocess.pid) + subprocess.kill('SIGTERM') + } this.subprocess = null } diff --git a/test/api.spec.js b/test/api.spec.js index 249c159d..9b827841 100644 --- a/test/api.spec.js +++ b/test/api.spec.js @@ -43,7 +43,7 @@ describe('ipfsd.api for Daemons', () => { this.timeout(20 * 1000) // TODO skip in browser - can we avoid using file system operations here? - if (!isNode) { this.skip() } + if (!isNode) { return this.skip() } // TODO: fix on Windows // - https://github.com/ipfs/js-ipfsd-ctl/pull/155#issuecomment-326970190 From ec5883172a91baae6f6c3e446f499e9d621666bf Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 15:26:51 +1300 Subject: [PATCH 02/25] feat: use api/v0/shutdown to stop a deamon --- test/add-retrieve.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/add-retrieve.spec.js b/test/add-retrieve.spec.js index 439efb35..f1f43269 100644 --- a/test/add-retrieve.spec.js +++ b/test/add-retrieve.spec.js @@ -21,7 +21,7 @@ describe('data can be put and fetched', () => { let ipfsd before(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) const f = IPFSFactory.create(dfOpts) @@ -37,7 +37,7 @@ describe('data can be put and fetched', () => { }) after(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.stop(done) }) From 1db2ae4d47989dd4a5e8688617392a5287a563f5 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 16:00:30 +1300 Subject: [PATCH 03/25] test: work on windows --- test/api.spec.js | 16 ++++++++-------- test/start-stop.node.js | 31 +++++++++++-------------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/test/api.spec.js b/test/api.spec.js index 9b827841..74111b1c 100644 --- a/test/api.spec.js +++ b/test/api.spec.js @@ -11,10 +11,7 @@ const series = require('async/series') const multiaddr = require('multiaddr') const path = require('path') const DaemonFactory = require('../src') -const os = require('os') - const isNode = require('detect-node') -const isWindows = os.platform() === 'win32' const tests = [ { type: 'go' }, @@ -40,16 +37,15 @@ describe('ipfsd.api for Daemons', () => { }) it('test the ipfsd.api', function (done) { +<<<<<<< HEAD this.timeout(20 * 1000) +======= + this.timeout(80 * 1000) +>>>>>>> test: work on windows // TODO skip in browser - can we avoid using file system operations here? if (!isNode) { return this.skip() } - // TODO: fix on Windows - // - https://github.com/ipfs/js-ipfsd-ctl/pull/155#issuecomment-326970190 - // - https://github.com/ipfs/js-ipfs-api/issues/408 - if (isWindows) { return this.skip() } - let ipfsd let api @@ -112,7 +108,11 @@ describe('ipfsd.api for Daemons', () => { }) it('check if API and Gateway addrs are correct', function (done) { +<<<<<<< HEAD this.timeout(20 * 1000) +======= + this.timeout(80 * 1000) +>>>>>>> test: work on windows df.spawn({ config: config, diff --git a/test/start-stop.node.js b/test/start-stop.node.js index 7ce59707..4ace01f4 100644 --- a/test/start-stop.node.js +++ b/test/start-stop.node.js @@ -10,10 +10,8 @@ chai.use(dirtyChai) const async = require('async') const fs = require('fs') const path = require('path') -const os = require('os') const isrunning = require('is-running') -const isWindows = os.platform() === 'win32' const findIpfsExecutable = require('../src/utils/find-ipfs-executable') const tempDir = require('../src/utils/tmp-dir') const IPFSFactory = require('../src') @@ -35,8 +33,6 @@ tests.forEach((fOpts) => { const dfConfig = Object.assign({}, dfBaseConfig, { type: fOpts.type }) describe('start and stop', () => { - if (isWindows) { return } - let ipfsd let repoPath let api @@ -44,7 +40,7 @@ tests.forEach((fOpts) => { let stopped = false before(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) const f = IPFSFactory.create(dfConfig) @@ -70,7 +66,7 @@ tests.forEach((fOpts) => { it('daemon exec path should match type', () => { let execPath = exec[fOpts.type] - expect(ipfsd.exec).to.include.string(execPath) + expect(ipfsd.exec).to.include.string(path.join(execPath)) }) it('daemon should not be running', (done) => { @@ -81,7 +77,7 @@ tests.forEach((fOpts) => { }) it('.start', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.start((err, ipfs) => { expect(err).to.not.exist() @@ -101,7 +97,7 @@ tests.forEach((fOpts) => { }) it('.stop', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.stop((err) => { expect(err).to.not.exist() @@ -121,7 +117,7 @@ tests.forEach((fOpts) => { it('is stopped', function (done) { // shutdown grace period is already 10500 - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.pid((pid) => { expect(pid).to.not.exist() @@ -137,6 +133,7 @@ tests.forEach((fOpts) => { }) it('fail on start with non supported flags', function (done) { + this.timeout(80 * 1000) // TODO js-ipfs doesn't fail on unrecognized args. // Decided what should be the desired behaviour if (fOpts.type === 'js') { return this.skip() } @@ -164,7 +161,7 @@ tests.forEach((fOpts) => { let exec before(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) const df = IPFSFactory.create(dfConfig) exec = findIpfsExecutable(fOpts.type) @@ -193,7 +190,7 @@ tests.forEach((fOpts) => { }) describe('should fail on invalid exec path', function () { - this.timeout(20 * 1000) + this.timeout(80 * 1000) let ipfsd before((done) => { @@ -229,7 +226,7 @@ tests.forEach((fOpts) => { let ipfsd before(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) const f = IPFSFactory.create(dfConfig) @@ -277,10 +274,7 @@ tests.forEach((fOpts) => { }) it('.stop', function (done) { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.stop((err) => { expect(err).to.not.exist() @@ -307,10 +301,7 @@ tests.forEach((fOpts) => { }) it('.stop and cleanup', function (done) { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.stop((err) => { expect(err).to.not.exist() From 6ecc02aa218eed38c9ef19ab8601b73d6a39610e Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 16:38:34 +1300 Subject: [PATCH 04/25] test: timeout issues --- test/spawn-options.spec.js | 43 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/test/spawn-options.spec.js b/test/spawn-options.spec.js index 3b3e4721..56eb81f2 100644 --- a/test/spawn-options.spec.js +++ b/test/spawn-options.spec.js @@ -30,7 +30,9 @@ const versions = { proc: jsVersion } -describe('Spawn options', () => { +describe('Spawn options', function () { + this.timeout(80 * 1000) + tests.forEach((fOpts) => describe(`${fOpts.type}`, () => { const VERSION_STRING = versions[fOpts.type] let f @@ -41,7 +43,7 @@ describe('Spawn options', () => { // TODO document this method on the readme it('f.version', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) f.version({ type: fOpts.type }, (err, version) => { expect(err).to.not.exist() @@ -88,7 +90,7 @@ describe('Spawn options', () => { }) it('ipfsd.init', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.init((err) => { expect(err).to.not.exist() @@ -98,7 +100,7 @@ describe('Spawn options', () => { }) it('ipfsd.start', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.start((err, api) => { expect(err).to.not.exist() @@ -109,7 +111,7 @@ describe('Spawn options', () => { }) it('ipfsd.stop', function (done) { - this.timeout(10 * 1000) + this.timeout(80 * 1000) ipfsd.stop(done) }) @@ -124,10 +126,7 @@ describe('Spawn options', () => { let ipfsd it('f.spawn', function (done) { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - - this.timeout(20 * 1000) + this.timeout(80 * 1000) const options = { repoPath: prevRepoPath, @@ -147,10 +146,7 @@ describe('Spawn options', () => { }) it('ipfsd.start', function (done) { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.start((err, api) => { expect(err).to.not.exist() @@ -161,10 +157,7 @@ describe('Spawn options', () => { }) it('ipfsd.stop', function (done) { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.stop(done) }) @@ -176,7 +169,7 @@ describe('Spawn options', () => { let ipfsd it('create init and start node', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) f.spawn({ initOptions: { bits: fOpts.bits } }, (err, _ipfsd) => { @@ -191,7 +184,7 @@ describe('Spawn options', () => { }) it('ipfsd.stop', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.stop(done) }) @@ -199,7 +192,7 @@ describe('Spawn options', () => { describe('custom config options', () => { it('custom config', function (done) { - this.timeout(30 * 1000) + this.timeout(80 * 1000) const addr = '/ip4/127.0.0.1/tcp/5678' const swarmAddr1 = '/ip4/127.0.0.1/tcp/35666' @@ -256,7 +249,7 @@ describe('Spawn options', () => { }) it('allows passing custom repo path to spawn', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) const config = { Addresses: { @@ -311,7 +304,7 @@ describe('Spawn options', () => { let ipfsd it('spawn with pubsub', function (done) { - this.timeout(30 * 1000) + this.timeout(80 * 1000) const options = { args: ['--enable-pubsub-experiment'], @@ -344,7 +337,7 @@ describe('Spawn options', () => { }) it('ipfsd.stop', function (done) { - this.timeout(10 * 1000) + this.timeout(80 * 1000) ipfsd.stop(done) }) }) @@ -353,7 +346,7 @@ describe('Spawn options', () => { let ipfsd before(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) f.spawn({ initOptions: { bits: fOpts.bits } }, (err, _ipfsd) => { expect(err).to.not.exist() @@ -384,7 +377,7 @@ describe('Spawn options', () => { }) it('Should set a config value', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) series([ (cb) => ipfsd.setConfig('Bootstrap', 'null', cb), From 252e1d535c095bca874da23a51eabec45cb4fa4e Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Thu, 22 Feb 2018 12:11:06 +1300 Subject: [PATCH 05/25] fix: timeout --- test/api.spec.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/api.spec.js b/test/api.spec.js index 74111b1c..5b4b5087 100644 --- a/test/api.spec.js +++ b/test/api.spec.js @@ -37,11 +37,7 @@ describe('ipfsd.api for Daemons', () => { }) it('test the ipfsd.api', function (done) { -<<<<<<< HEAD - this.timeout(20 * 1000) -======= this.timeout(80 * 1000) ->>>>>>> test: work on windows // TODO skip in browser - can we avoid using file system operations here? if (!isNode) { return this.skip() } @@ -108,11 +104,7 @@ describe('ipfsd.api for Daemons', () => { }) it('check if API and Gateway addrs are correct', function (done) { -<<<<<<< HEAD - this.timeout(20 * 1000) -======= this.timeout(80 * 1000) ->>>>>>> test: work on windows df.spawn({ config: config, From c3315ac6f4f550865093b7e6bb6a1b4b333c7db6 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Thu, 22 Feb 2018 12:45:54 +1300 Subject: [PATCH 06/25] test: run on windows --- test/spawn-options.spec.js | 3 --- test/start-stop.node.js | 11 +---------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/test/spawn-options.spec.js b/test/spawn-options.spec.js index 56eb81f2..e0084b26 100644 --- a/test/spawn-options.spec.js +++ b/test/spawn-options.spec.js @@ -13,9 +13,6 @@ const isNode = require('detect-node') const hat = require('hat') const IPFSFactory = require('../src') const JSIPFS = require('ipfs') -const os = require('os') - -const isWindows = os.platform() === 'win32' const tests = [ { type: 'go', bits: 1024 }, diff --git a/test/start-stop.node.js b/test/start-stop.node.js index 4ace01f4..7671d6b3 100644 --- a/test/start-stop.node.js +++ b/test/start-stop.node.js @@ -257,16 +257,10 @@ tests.forEach((fOpts) => { }) it('should return a node', function () { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - expect(ipfsd).to.exist() }) it('daemon should be running', function (done) { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - ipfsd.pid((pid) => { expect(pid).to.exist() done() @@ -286,10 +280,7 @@ tests.forEach((fOpts) => { }) it('.start', function (done) { - // TODO: wont work on windows until we get `/shutdown` implemented in js-ipfs - if (isWindows) { this.skip() } - - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.start((err) => { expect(err).to.not.exist() From 67a20411b3405d00ffad74c67223f53943e4cbad Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 24 Feb 2018 10:53:52 +1300 Subject: [PATCH 07/25] chore: force a build --- src/ipfsd-daemon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index 98a26350..597cf0e8 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -282,7 +282,7 @@ class Daemon { const self = this const subprocess = this.subprocess const timeout = setTimeout(() => { - log('kill timeout, using SIGKILL', subprocess.pid) + log('kill timeout, using SIGKILL.', subprocess.pid) subprocess.kill('SIGKILL') }, GRACE_PERIOD) From 8cd5abe3017444e2699b170b5dd501ae302b2b5f Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Fri, 2 Mar 2018 08:26:50 +1300 Subject: [PATCH 08/25] chore: update dependency on ipfs --- package.json | 2 +- src/ipfsd-daemon.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1af0f6b2..2d145159 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "detect-port": "^1.2.2", "dirty-chai": "^2.0.1", "go-ipfs-dep": "0.4.13", - "ipfs": "github:ipfs/js-ipfs", + "ipfs": "~0.28.0", "is-running": "1.0.5", "mkdirp": "^0.5.1", "pre-commit": "^1.2.2", diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index 597cf0e8..98a26350 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -282,7 +282,7 @@ class Daemon { const self = this const subprocess = this.subprocess const timeout = setTimeout(() => { - log('kill timeout, using SIGKILL.', subprocess.pid) + log('kill timeout, using SIGKILL', subprocess.pid) subprocess.kill('SIGKILL') }, GRACE_PERIOD) From b1dc8ee4a7d1ead83770b060c5ceeaf48eef21cc Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 15:26:51 +1300 Subject: [PATCH 09/25] feat: use api/v0/shutdown to stop a deamon --- test/add-retrieve.spec.js | 4 ++-- test/api.spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/add-retrieve.spec.js b/test/add-retrieve.spec.js index f1f43269..c40057de 100644 --- a/test/add-retrieve.spec.js +++ b/test/add-retrieve.spec.js @@ -21,7 +21,7 @@ describe('data can be put and fetched', () => { let ipfsd before(function (done) { - this.timeout(80 * 1000) + this.timeout(30 * 1000) const f = IPFSFactory.create(dfOpts) @@ -37,7 +37,7 @@ describe('data can be put and fetched', () => { }) after(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop(done) }) diff --git a/test/api.spec.js b/test/api.spec.js index 5b4b5087..1403fbfc 100644 --- a/test/api.spec.js +++ b/test/api.spec.js @@ -37,7 +37,7 @@ describe('ipfsd.api for Daemons', () => { }) it('test the ipfsd.api', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) // TODO skip in browser - can we avoid using file system operations here? if (!isNode) { return this.skip() } @@ -104,7 +104,7 @@ describe('ipfsd.api for Daemons', () => { }) it('check if API and Gateway addrs are correct', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) df.spawn({ config: config, From 4f0c14d0eb42124afb3e2a10e1ba83d3be13e9e8 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 16:00:30 +1300 Subject: [PATCH 10/25] test: work on windows --- test/start-stop.node.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/test/start-stop.node.js b/test/start-stop.node.js index 7671d6b3..66180506 100644 --- a/test/start-stop.node.js +++ b/test/start-stop.node.js @@ -40,7 +40,7 @@ tests.forEach((fOpts) => { let stopped = false before(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const f = IPFSFactory.create(dfConfig) @@ -77,7 +77,7 @@ tests.forEach((fOpts) => { }) it('.start', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.start((err, ipfs) => { expect(err).to.not.exist() @@ -97,7 +97,7 @@ tests.forEach((fOpts) => { }) it('.stop', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop((err) => { expect(err).to.not.exist() @@ -117,7 +117,7 @@ tests.forEach((fOpts) => { it('is stopped', function (done) { // shutdown grace period is already 10500 - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.pid((pid) => { expect(pid).to.not.exist() @@ -133,7 +133,6 @@ tests.forEach((fOpts) => { }) it('fail on start with non supported flags', function (done) { - this.timeout(80 * 1000) // TODO js-ipfs doesn't fail on unrecognized args. // Decided what should be the desired behaviour if (fOpts.type === 'js') { return this.skip() } @@ -161,7 +160,7 @@ tests.forEach((fOpts) => { let exec before(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const df = IPFSFactory.create(dfConfig) exec = findIpfsExecutable(fOpts.type) @@ -190,7 +189,7 @@ tests.forEach((fOpts) => { }) describe('should fail on invalid exec path', function () { - this.timeout(80 * 1000) + this.timeout(20 * 1000) let ipfsd before((done) => { @@ -226,7 +225,7 @@ tests.forEach((fOpts) => { let ipfsd before(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const f = IPFSFactory.create(dfConfig) @@ -268,7 +267,7 @@ tests.forEach((fOpts) => { }) it('.stop', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop((err) => { expect(err).to.not.exist() @@ -280,7 +279,7 @@ tests.forEach((fOpts) => { }) it('.start', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.start((err) => { expect(err).to.not.exist() @@ -292,7 +291,7 @@ tests.forEach((fOpts) => { }) it('.stop and cleanup', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop((err) => { expect(err).to.not.exist() From 3b32c030bc93358bd6257ed9f1614fa2f8ee9be5 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 16:38:34 +1300 Subject: [PATCH 11/25] test: timeout issues --- test/spawn-options.spec.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/spawn-options.spec.js b/test/spawn-options.spec.js index e0084b26..92f237c3 100644 --- a/test/spawn-options.spec.js +++ b/test/spawn-options.spec.js @@ -123,7 +123,7 @@ describe('Spawn options', function () { let ipfsd it('f.spawn', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const options = { repoPath: prevRepoPath, @@ -143,7 +143,7 @@ describe('Spawn options', function () { }) it('ipfsd.start', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.start((err, api) => { expect(err).to.not.exist() @@ -154,7 +154,7 @@ describe('Spawn options', function () { }) it('ipfsd.stop', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop(done) }) @@ -166,7 +166,7 @@ describe('Spawn options', function () { let ipfsd it('create init and start node', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) f.spawn({ initOptions: { bits: fOpts.bits } }, (err, _ipfsd) => { @@ -181,7 +181,7 @@ describe('Spawn options', function () { }) it('ipfsd.stop', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop(done) }) @@ -189,7 +189,7 @@ describe('Spawn options', function () { describe('custom config options', () => { it('custom config', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const addr = '/ip4/127.0.0.1/tcp/5678' const swarmAddr1 = '/ip4/127.0.0.1/tcp/35666' @@ -246,7 +246,7 @@ describe('Spawn options', function () { }) it('allows passing custom repo path to spawn', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const config = { Addresses: { @@ -301,7 +301,7 @@ describe('Spawn options', function () { let ipfsd it('spawn with pubsub', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const options = { args: ['--enable-pubsub-experiment'], @@ -334,7 +334,7 @@ describe('Spawn options', function () { }) it('ipfsd.stop', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop(done) }) }) @@ -343,7 +343,7 @@ describe('Spawn options', function () { let ipfsd before(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) f.spawn({ initOptions: { bits: fOpts.bits } }, (err, _ipfsd) => { expect(err).to.not.exist() @@ -374,7 +374,7 @@ describe('Spawn options', function () { }) it('Should set a config value', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) series([ (cb) => ipfsd.setConfig('Bootstrap', 'null', cb), From 2aec828f8223a3940d11ff763ecb9ac7402c75a8 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 15:26:51 +1300 Subject: [PATCH 12/25] feat: use api/v0/shutdown to stop a deamon --- test/add-retrieve.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/add-retrieve.spec.js b/test/add-retrieve.spec.js index c40057de..7a2d8062 100644 --- a/test/add-retrieve.spec.js +++ b/test/add-retrieve.spec.js @@ -37,7 +37,7 @@ describe('data can be put and fetched', () => { }) after(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.stop(done) }) From 22c4ae9ad1a8e4fafab3049ebae217378139b29a Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 17 Feb 2018 16:00:30 +1300 Subject: [PATCH 13/25] test: work on windows --- test/api.spec.js | 8 ++++++++ test/start-stop.node.js | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/api.spec.js b/test/api.spec.js index 1403fbfc..74111b1c 100644 --- a/test/api.spec.js +++ b/test/api.spec.js @@ -37,7 +37,11 @@ describe('ipfsd.api for Daemons', () => { }) it('test the ipfsd.api', function (done) { +<<<<<<< HEAD this.timeout(20 * 1000) +======= + this.timeout(80 * 1000) +>>>>>>> test: work on windows // TODO skip in browser - can we avoid using file system operations here? if (!isNode) { return this.skip() } @@ -104,7 +108,11 @@ describe('ipfsd.api for Daemons', () => { }) it('check if API and Gateway addrs are correct', function (done) { +<<<<<<< HEAD this.timeout(20 * 1000) +======= + this.timeout(80 * 1000) +>>>>>>> test: work on windows df.spawn({ config: config, diff --git a/test/start-stop.node.js b/test/start-stop.node.js index 66180506..44f9578b 100644 --- a/test/start-stop.node.js +++ b/test/start-stop.node.js @@ -117,7 +117,7 @@ tests.forEach((fOpts) => { it('is stopped', function (done) { // shutdown grace period is already 10500 - this.timeout(20 * 1000) + this.timeout(80 * 1000) ipfsd.pid((pid) => { expect(pid).to.not.exist() @@ -160,7 +160,7 @@ tests.forEach((fOpts) => { let exec before(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) const df = IPFSFactory.create(dfConfig) exec = findIpfsExecutable(fOpts.type) @@ -189,7 +189,7 @@ tests.forEach((fOpts) => { }) describe('should fail on invalid exec path', function () { - this.timeout(20 * 1000) + this.timeout(80 * 1000) let ipfsd before((done) => { @@ -225,7 +225,7 @@ tests.forEach((fOpts) => { let ipfsd before(function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) const f = IPFSFactory.create(dfConfig) From 74f6dc8b3b546995ad0ea4091286edc38b40a48f Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 7 Mar 2018 18:34:51 -0600 Subject: [PATCH 14/25] fix: only use ipfs if its `ready` --- src/factory-in-proc.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/factory-in-proc.js b/src/factory-in-proc.js index c9ad38ab..3fbb0e05 100644 --- a/src/factory-in-proc.js +++ b/src/factory-in-proc.js @@ -65,10 +65,14 @@ class FactoryInProc { callback = options options = {} } - const IPFS = this.exec - new IPFS(options).version((err, _version) => { - if (err) { callback(err) } - callback(null, _version) + + const IPFS = this.exec // otherwise lit barfs + const ipfs = new IPFS(options) + ipfs.once('ready', () => { + ipfs.version((err, _version) => { + if (err) { callback(err) } + callback(null, _version) + }) }) } @@ -129,15 +133,16 @@ class FactoryInProc { } const node = new Node(options) - - series([ - (cb) => options.init - ? node.init(cb) - : cb(), - (cb) => options.start - ? node.start(options.args, cb) - : cb() - ], (err) => callback(err, node)) + node.exec.once('ready', () => { + series([ + (cb) => options.init + ? node.init(cb) + : cb(), + (cb) => options.start + ? node.start(options.args, cb) + : cb() + ], (err) => callback(err, node)) + }) } } From a5d0ec5b1a0243f0f3373444c601872e72083137 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 7 Mar 2018 18:46:50 -0600 Subject: [PATCH 15/25] fix: timeouts and conflicts --- test/add-retrieve.spec.js | 2 +- test/api.spec.js | 8 -------- test/spawn-options.spec.js | 10 +++++----- test/start-stop.node.js | 8 ++++---- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/test/add-retrieve.spec.js b/test/add-retrieve.spec.js index 7a2d8062..c40057de 100644 --- a/test/add-retrieve.spec.js +++ b/test/add-retrieve.spec.js @@ -37,7 +37,7 @@ describe('data can be put and fetched', () => { }) after(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop(done) }) diff --git a/test/api.spec.js b/test/api.spec.js index 74111b1c..1403fbfc 100644 --- a/test/api.spec.js +++ b/test/api.spec.js @@ -37,11 +37,7 @@ describe('ipfsd.api for Daemons', () => { }) it('test the ipfsd.api', function (done) { -<<<<<<< HEAD this.timeout(20 * 1000) -======= - this.timeout(80 * 1000) ->>>>>>> test: work on windows // TODO skip in browser - can we avoid using file system operations here? if (!isNode) { return this.skip() } @@ -108,11 +104,7 @@ describe('ipfsd.api for Daemons', () => { }) it('check if API and Gateway addrs are correct', function (done) { -<<<<<<< HEAD this.timeout(20 * 1000) -======= - this.timeout(80 * 1000) ->>>>>>> test: work on windows df.spawn({ config: config, diff --git a/test/spawn-options.spec.js b/test/spawn-options.spec.js index 92f237c3..d1bba4ad 100644 --- a/test/spawn-options.spec.js +++ b/test/spawn-options.spec.js @@ -28,7 +28,7 @@ const versions = { } describe('Spawn options', function () { - this.timeout(80 * 1000) + this.timeout(20 * 1000) tests.forEach((fOpts) => describe(`${fOpts.type}`, () => { const VERSION_STRING = versions[fOpts.type] @@ -40,7 +40,7 @@ describe('Spawn options', function () { // TODO document this method on the readme it('f.version', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) f.version({ type: fOpts.type }, (err, version) => { expect(err).to.not.exist() @@ -87,7 +87,7 @@ describe('Spawn options', function () { }) it('ipfsd.init', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.init((err) => { expect(err).to.not.exist() @@ -97,7 +97,7 @@ describe('Spawn options', function () { }) it('ipfsd.start', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.start((err, api) => { expect(err).to.not.exist() @@ -108,7 +108,7 @@ describe('Spawn options', function () { }) it('ipfsd.stop', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.stop(done) }) diff --git a/test/start-stop.node.js b/test/start-stop.node.js index 44f9578b..66180506 100644 --- a/test/start-stop.node.js +++ b/test/start-stop.node.js @@ -117,7 +117,7 @@ tests.forEach((fOpts) => { it('is stopped', function (done) { // shutdown grace period is already 10500 - this.timeout(80 * 1000) + this.timeout(20 * 1000) ipfsd.pid((pid) => { expect(pid).to.not.exist() @@ -160,7 +160,7 @@ tests.forEach((fOpts) => { let exec before(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const df = IPFSFactory.create(dfConfig) exec = findIpfsExecutable(fOpts.type) @@ -189,7 +189,7 @@ tests.forEach((fOpts) => { }) describe('should fail on invalid exec path', function () { - this.timeout(80 * 1000) + this.timeout(20 * 1000) let ipfsd before((done) => { @@ -225,7 +225,7 @@ tests.forEach((fOpts) => { let ipfsd before(function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) const f = IPFSFactory.create(dfConfig) From b3444f85f941ee0073b615afbf084522167666c8 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 7 Mar 2018 18:56:14 -0600 Subject: [PATCH 16/25] typo --- src/factory-in-proc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/factory-in-proc.js b/src/factory-in-proc.js index 3fbb0e05..cc220079 100644 --- a/src/factory-in-proc.js +++ b/src/factory-in-proc.js @@ -66,7 +66,7 @@ class FactoryInProc { options = {} } - const IPFS = this.exec // otherwise lit barfs + const IPFS = this.exec // otherwise lint barfs const ipfs = new IPFS(options) ipfs.once('ready', () => { ipfs.version((err, _version) => { From 162ffb8047ae45b23edf1a2f1da6256a8f7b1cd9 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Thu, 8 Mar 2018 20:49:02 -0600 Subject: [PATCH 17/25] fix: return callback on error --- src/factory-in-proc.js | 2 +- src/ipfsd-daemon.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/factory-in-proc.js b/src/factory-in-proc.js index cc220079..eeb198e5 100644 --- a/src/factory-in-proc.js +++ b/src/factory-in-proc.js @@ -70,7 +70,7 @@ class FactoryInProc { const ipfs = new IPFS(options) ipfs.once('ready', () => { ipfs.version((err, _version) => { - if (err) { callback(err) } + if (err) { return callback(err) } callback(null, _version) }) }) diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index 98a26350..0c46cc03 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -279,7 +279,6 @@ class Daemon { */ killProcess (callback) { // need a local var for the closure, as we clear the var. - const self = this const subprocess = this.subprocess const timeout = setTimeout(() => { log('kill timeout, using SIGKILL', subprocess.pid) @@ -289,10 +288,10 @@ class Daemon { subprocess.once('exit', () => { log('killed', subprocess.pid) clearTimeout(timeout) - self.subprocess = null - self._started = false - if (self.disposable) { - return self.cleanup(callback) + this.subprocess = null + this._started = false + if (this.disposable) { + return this.cleanup(callback) } setImmediate(callback) }) From 36fbb7a53df01148cdb125adb9c436705111c58a Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Thu, 8 Mar 2018 21:01:57 -0600 Subject: [PATCH 18/25] fix: use this instead of self --- src/ipfsd-daemon.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ipfsd-daemon.js b/src/ipfsd-daemon.js index 0c46cc03..732e4777 100644 --- a/src/ipfsd-daemon.js +++ b/src/ipfsd-daemon.js @@ -148,14 +148,13 @@ class Daemon { return callback(err) } - const self = this waterfall([ (cb) => this.getConfig(cb), (conf, cb) => this.replaceConfig(defaults({}, this.opts.config, conf), cb) ], (err) => { if (err) { return callback(err) } - self.clean = false - self.initialized = true + this.clean = false + this.initialized = true return callback() }) }) From 5fc58bb071878f5ea1a6f4c24d48410a4cebe7af Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 12 Mar 2018 23:49:56 -0600 Subject: [PATCH 19/25] fix: correctly initialize proc nodes --- .gitignore | 3 +++ src/factory-in-proc.js | 12 +++++------- src/ipfsd-in-proc.js | 15 ++++++++++++--- test/spawn-options.spec.js | 4 ++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 011edeae..251b74d8 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ dist docs .idea + +.nyc_output +.vscode diff --git a/src/factory-in-proc.js b/src/factory-in-proc.js index eeb198e5..c6b84487 100644 --- a/src/factory-in-proc.js +++ b/src/factory-in-proc.js @@ -66,12 +66,11 @@ class FactoryInProc { options = {} } - const IPFS = this.exec // otherwise lint barfs - const ipfs = new IPFS(options) - ipfs.once('ready', () => { - ipfs.version((err, _version) => { + const node = new Node(options) + node.once('ready', () => { + node.init((err) => { if (err) { return callback(err) } - callback(null, _version) + node.version(callback) }) }) } @@ -101,7 +100,6 @@ class FactoryInProc { } const options = defaults({}, opts, defaultOptions) - options.init = typeof options.init !== 'undefined' ? options.init : true @@ -133,7 +131,7 @@ class FactoryInProc { } const node = new Node(options) - node.exec.once('ready', () => { + node.once('ready', () => { series([ (cb) => options.init ? node.init(cb) diff --git a/src/ipfsd-in-proc.js b/src/ipfsd-in-proc.js index 2866212a..00d63188 100644 --- a/src/ipfsd-in-proc.js +++ b/src/ipfsd-in-proc.js @@ -6,13 +6,16 @@ const createRepo = require('./utils/repo/create-nodejs') const defaults = require('lodash.defaults') const waterfall = require('async/waterfall') const debug = require('debug') +const EventEmitter = require('events') const log = debug('ipfsd-ctl:in-proc') +let IPFS = null + /** * ipfsd for a js-ipfs instance (aka in-process IPFS node) */ -class Node { +class Node extends EventEmitter { /** * Create a new node. * @@ -21,9 +24,10 @@ class Node { * @returns {Node} */ constructor (opts) { + super() this.opts = opts || {} - const IPFS = this.opts.exec + IPFS = this.opts.exec this.opts.args = this.opts.args || [] this.path = this.opts.repoPath @@ -68,6 +72,8 @@ class Node { EXPERIMENTAL: this.opts.EXPERIMENTAL, libp2p: this.opts.libp2p }) + + this.exec.once('ready', () => setImmediate(() => this.emit('ready'))) } /** @@ -306,7 +312,10 @@ class Node { * @returns {undefined} */ version (callback) { - this.exec.version(callback) + this.exec.version((err, _version) => { + if (err) { return callback(err) } + callback(null, _version) + }) } } diff --git a/test/spawn-options.spec.js b/test/spawn-options.spec.js index d1bba4ad..12150f8a 100644 --- a/test/spawn-options.spec.js +++ b/test/spawn-options.spec.js @@ -40,9 +40,9 @@ describe('Spawn options', function () { // TODO document this method on the readme it('f.version', function (done) { - this.timeout(20 * 1000) + this.timeout(80 * 1000) - f.version({ type: fOpts.type }, (err, version) => { + f.version({ type: fOpts.type, exec: fOpts.exec }, (err, version) => { expect(err).to.not.exist() if (fOpts.type === 'proc') { version = version.version } expect(version).to.be.eql(VERSION_STRING) From b1f55384ce44bb47d12e1ad4d984f2544a8218e0 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 12 Mar 2018 23:59:45 -0600 Subject: [PATCH 20/25] fix: no need for setImmediate --- src/ipfsd-in-proc.js | 2 +- test/spawn-options.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipfsd-in-proc.js b/src/ipfsd-in-proc.js index 00d63188..ee7963bd 100644 --- a/src/ipfsd-in-proc.js +++ b/src/ipfsd-in-proc.js @@ -73,7 +73,7 @@ class Node extends EventEmitter { libp2p: this.opts.libp2p }) - this.exec.once('ready', () => setImmediate(() => this.emit('ready'))) + this.exec.once('ready', () => this.emit('ready')) } /** diff --git a/test/spawn-options.spec.js b/test/spawn-options.spec.js index 12150f8a..ba2d4049 100644 --- a/test/spawn-options.spec.js +++ b/test/spawn-options.spec.js @@ -40,7 +40,7 @@ describe('Spawn options', function () { // TODO document this method on the readme it('f.version', function (done) { - this.timeout(80 * 1000) + this.timeout(20 * 1000) f.version({ type: fOpts.type, exec: fOpts.exec }, (err, version) => { expect(err).to.not.exist() From a61fa50d6834e61465398cd1d54e60ec913358eb Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 13 Mar 2018 00:01:51 -0600 Subject: [PATCH 21/25] fix: simplify version call --- src/ipfsd-in-proc.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ipfsd-in-proc.js b/src/ipfsd-in-proc.js index ee7963bd..8103833b 100644 --- a/src/ipfsd-in-proc.js +++ b/src/ipfsd-in-proc.js @@ -312,10 +312,7 @@ class Node extends EventEmitter { * @returns {undefined} */ version (callback) { - this.exec.version((err, _version) => { - if (err) { return callback(err) } - callback(null, _version) - }) + this.exec.version(callback) } } From 2d3cf40d4fc52ba12d679b2060e66196db775e3a Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 13 Mar 2018 12:00:01 -0600 Subject: [PATCH 22/25] fix: timeouts --- test/api.spec.js | 4 ++-- test/spawn-options.spec.js | 2 +- test/start-stop.node.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/api.spec.js b/test/api.spec.js index 1403fbfc..df37a847 100644 --- a/test/api.spec.js +++ b/test/api.spec.js @@ -37,7 +37,7 @@ describe('ipfsd.api for Daemons', () => { }) it('test the ipfsd.api', function (done) { - this.timeout(20 * 1000) + this.timeout(50 * 1000) // TODO skip in browser - can we avoid using file system operations here? if (!isNode) { return this.skip() } @@ -104,7 +104,7 @@ describe('ipfsd.api for Daemons', () => { }) it('check if API and Gateway addrs are correct', function (done) { - this.timeout(20 * 1000) + this.timeout(50 * 1000) df.spawn({ config: config, diff --git a/test/spawn-options.spec.js b/test/spawn-options.spec.js index ba2d4049..6f56be4c 100644 --- a/test/spawn-options.spec.js +++ b/test/spawn-options.spec.js @@ -189,7 +189,7 @@ describe('Spawn options', function () { describe('custom config options', () => { it('custom config', function (done) { - this.timeout(20 * 1000) + this.timeout(50 * 1000) const addr = '/ip4/127.0.0.1/tcp/5678' const swarmAddr1 = '/ip4/127.0.0.1/tcp/35666' diff --git a/test/start-stop.node.js b/test/start-stop.node.js index 66180506..6955b0c8 100644 --- a/test/start-stop.node.js +++ b/test/start-stop.node.js @@ -40,7 +40,7 @@ tests.forEach((fOpts) => { let stopped = false before(function (done) { - this.timeout(20 * 1000) + this.timeout(50 * 1000) const f = IPFSFactory.create(dfConfig) @@ -160,7 +160,7 @@ tests.forEach((fOpts) => { let exec before(function (done) { - this.timeout(20 * 1000) + this.timeout(50 * 1000) const df = IPFSFactory.create(dfConfig) exec = findIpfsExecutable(fOpts.type) From 3ffcee3dbb9ef65083ebb0afdb262028f4fc4da6 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 13 Mar 2018 17:05:18 -0600 Subject: [PATCH 23/25] fix: no need to init repo to get version --- .aegir.js | 2 +- src/factory-in-proc.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.aegir.js b/.aegir.js index 36e730a6..62f5021e 100644 --- a/.aegir.js +++ b/.aegir.js @@ -11,7 +11,7 @@ module.exports = { served: true, included: false }], - singleRun: true + singleRun: false }, hooks: { browser: { diff --git a/src/factory-in-proc.js b/src/factory-in-proc.js index c6b84487..d844a3ca 100644 --- a/src/factory-in-proc.js +++ b/src/factory-in-proc.js @@ -68,10 +68,7 @@ class FactoryInProc { const node = new Node(options) node.once('ready', () => { - node.init((err) => { - if (err) { return callback(err) } - node.version(callback) - }) + node.version(callback) }) } From 4ad247b9ca66d496f86f473eae8e857eee3fdb64 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 13 Mar 2018 17:20:18 -0600 Subject: [PATCH 24/25] fix: remove singleRun --- .aegir.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.aegir.js b/.aegir.js index 62f5021e..36e730a6 100644 --- a/.aegir.js +++ b/.aegir.js @@ -11,7 +11,7 @@ module.exports = { served: true, included: false }], - singleRun: false + singleRun: true }, hooks: { browser: { From 36aa183690ec61a19ac6edf2f8d2c387341635ad Mon Sep 17 00:00:00 2001 From: David Dias Date: Wed, 14 Mar 2018 07:10:41 -0700 Subject: [PATCH 25/25] chore: update deps --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 2d145159..6b5d1679 100644 --- a/package.json +++ b/package.json @@ -74,42 +74,42 @@ "license": "MIT", "dependencies": { "async": "^2.6.0", - "boom": "^7.1.1", + "boom": "^7.2.0", "debug": "^3.1.0", "detect-node": "^2.0.3", "hapi": "^16.6.2", "hat": "0.0.3", - "ipfs-api": "^18.1.1", - "ipfs-repo": "^0.18.5", - "joi": "^13.0.2", + "ipfs-api": "^18.1.2", + "ipfs-repo": "^0.18.7", + "joi": "^13.1.2", "lodash.clone": "^4.5.0", "lodash.defaults": "^4.2.0", "lodash.defaultsdeep": "^4.6.0", "multiaddr": "^3.0.2", "once": "^1.4.0", - "readable-stream": "^2.3.3", + "readable-stream": "^2.3.5", "rimraf": "^2.6.2", "safe-json-parse": "^4.0.0", - "safe-json-stringify": "^1.0.4", + "safe-json-stringify": "^1.1.0", "shutdown": "^0.3.0", - "stream-http": "^2.7.2", + "stream-http": "^2.8.0", "subcomandante": "^1.0.5", "superagent": "^3.8.2", "truthy": "0.0.1" }, "devDependencies": { - "aegir": "^12.4.0", + "aegir": "^13.0.6", "chai": "^4.1.2", - "cross-env": "^5.1.3", + "cross-env": "^5.1.4", "detect-port": "^1.2.2", "dirty-chai": "^2.0.1", "go-ipfs-dep": "0.4.13", - "ipfs": "~0.28.0", + "ipfs": "~0.28.2", "is-running": "1.0.5", "mkdirp": "^0.5.1", "pre-commit": "^1.2.2", - "proxyquire": "^1.8.0", - "sinon": "^4.1.3", + "proxyquire": "^2.0.0", + "sinon": "^4.4.5", "superagent-mocker": "^0.5.2", "supertest": "^3.0.0" },