-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add support to pass config in the init cmd #1662
Conversation
5b8b8d6
to
3079370
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏽👏🏽👏🏽👏🏽 great catch!!
@alanshaw can we get this one in the upcoming release? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome @hugomrdias - just one question, everything else LGTM
src/core/components/init.js
Outdated
@@ -4,6 +4,7 @@ const peerId = require('peer-id') | |||
const waterfall = require('async/waterfall') | |||
const parallel = require('async/parallel') | |||
const promisify = require('promisify-es6') | |||
const extend = require('deep-extend') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to use @nodeutils/defaults-deep
here? It's a missing dependency that we decided not to add here #1663 in favour of @nodeutils/defaults-deep
.
3079370
to
ca7677d
Compare
@alanshaw swap deep-extend with defaults-deep with last commit |
Just waiting for CI |
🎉🎉 |
This PR adds support to pass node config in the init cmd. The main purpose for this is to improve the speed of ipfsd-ctl and all the tests that use ctl.
example:
ipfs init '{"Addresses":{"Swarm":["/ip4/0.0.0.0/tcp/4003"]}}'
This merges the input config with the default config, just like the node api already does.
Check ipfsd-ctl PR related to this one for speed improvements ipfs/js-ipfsd-ctl#303
Right now we need to spawn 4 child_processes to start a node in ctl
With this PR we would only need 2
And with further changes we could do
ipfs daemon --init --config "{}"
Right now i think we have a couple of problems with this
Questions:
ipfs config merge
?Go version works like this https://docs.ipfs.io/reference/api/cli/#ipfs-init