Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements repository initialization with default config #2581

Merged
merged 1 commit into from
May 5, 2016

Conversation

sivachandran
Copy link
Contributor

Modified init command to receive default configuration from stdin. The changes enable us to use existing key-pair, datastore configuration while initializing new ipfs node.

License: MIT
Signed-off-by: Sivachandran sivachandran.p@gmail.com

@whyrusleeping

@whyrusleeping
Copy link
Member

@sivachandran I like this! I think for now, having it work this way is fine, but just as a note for the future, i'd like to be able to pass in partial configs, and have the rest autofilled by the init process.

Could you add a sharness test for this either in t0021-config.sh or create a new test file (t0022 or so).

@sivachandran
Copy link
Contributor Author

@whyrusleeping Added sharness test t0022-init-default.sh

'

test_expect_success "ipfs read config succeeds" '
export IPFS_DEFAULT_CONFIG=`cat "$IPFS_PATH"/config`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use export, thats a bash-ism and might not be supported by /bin/sh, Also it might work better to use:

IPFS_DEFAULT_CONFIG=$(cat "$IPFS_PATH/config")

Modified init command to receive default configuration from stdin. The changes enable us to use existing key-pair, datastore configuration while initializing new ipfs node.

License: MIT
Signed-off-by: Sivachandran <sivachandran.p@gmail.com>
@sivachandran
Copy link
Contributor Author

@whyrusleeping Updated the sharness

@whyrusleeping
Copy link
Member

@sivachandran awesome, this all LGTM. thanks!

@whyrusleeping whyrusleeping merged commit 2862e58 into ipfs:master May 5, 2016
@sivachandran sivachandran deleted the default-config branch May 6, 2016 02:50
@ghost ghost mentioned this pull request May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants