From 988078bf3a30a95279eeea0bb09be364700b34b8 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 27 Jan 2018 20:41:43 +1300 Subject: [PATCH 1/3] feat: passphrase for inproc deamons #186 --- src/in-proc-node.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/in-proc-node.js b/src/in-proc-node.js index 8ba6aa48..e75db27f 100644 --- a/src/in-proc-node.js +++ b/src/in-proc-node.js @@ -44,12 +44,23 @@ class Node { } }) - this.opts.EXPERIMENTAL.pubsub = (this.opts.args.indexOf('--enable-pubsub-experiment') > -1) - this.opts.EXPERIMENTAL.sharding = (this.opts.args.indexOf('--enable-sharding-experiment') > -1) + this.opts.args.forEach((arg) => { + if (arg === '--enable-pubsub-experiment') { + this.opts.EXPERIMENTAL.pubsub = true + } else if (arg === '--enable-sharding-experiment') { + this.opts.EXPERIMENTAL.sharding = true + } else if (arg.startsWith('--pass')) { + this.opts.pass = arg.split(' ').slice(1).join(' ') + } else { + // TODO: maybe throw! + throw new Error('Unkown argument ' + arg) + } + }) this.exec = new IPFS({ repo: this.repo, init: false, start: false, + pass: this.opts.pass, EXPERIMENTAL: this.opts.EXPERIMENTAL, libp2p: this.opts.libp2p }) From 4cc898d68a49e477c477f97a4f0f5d621fea2813 Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sat, 27 Jan 2018 21:57:13 +1300 Subject: [PATCH 2/3] fix: running JS on windows --- src/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/index.js b/src/utils/index.js index 63a462c2..18883359 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -89,7 +89,7 @@ exports.findIpfsExecutable = (type, rootPath) => { function run (node, args, opts, callback) { let executable = node.exec - if (isWindows && node.opts.type !== 'go') { + if (isWindows && executable.endsWith('.js')) { args = args || [] args.unshift(node.exec) executable = process.execPath From d104aa869f97f63f99eb06e01d5a2492835354dd Mon Sep 17 00:00:00 2001 From: Richard Schneider Date: Sun, 28 Jan 2018 08:33:41 +1300 Subject: [PATCH 3/3] chore: remove stale comment --- src/in-proc-node.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/in-proc-node.js b/src/in-proc-node.js index e75db27f..f06ac169 100644 --- a/src/in-proc-node.js +++ b/src/in-proc-node.js @@ -52,7 +52,6 @@ class Node { } else if (arg.startsWith('--pass')) { this.opts.pass = arg.split(' ').slice(1).join(' ') } else { - // TODO: maybe throw! throw new Error('Unkown argument ' + arg) } })