Skip to content

Gaiad init posts output to stderr #2628

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

Closed
4 tasks
faboweb opened this issue Oct 30, 2018 · 4 comments
Closed
4 tasks

Gaiad init posts output to stderr #2628

faboweb opened this issue Oct 30, 2018 · 4 comments

Comments

@faboweb
Copy link
Contributor

faboweb commented Oct 30, 2018

Summary of Bug

$ builds/Gaia/darwin_amd64/gaiad init --home /Users/fabo/.gaiad-testnet --name local -o --overwrite-key

This command produces the output on stderr which is used to identify if the script fails. @alessio

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alessio
Copy link
Contributor

alessio commented Oct 30, 2018

...which is correct :) stderr is for diagnostics and errors, and the command's outcome isn't to print anything but produce a initial genesis.json

@faboweb
Copy link
Contributor Author

faboweb commented Oct 30, 2018

Hmm, it also prints the seed words for the default account to the console. Isn't that an output? As long as we have no plan on how to prefix outputs (i.e. with [ERROR]/[DIAGNOSTIC]) it is (at least to me) confusing when non-errors are posted to stderr.

@alessio
Copy link
Contributor

alessio commented Oct 30, 2018

Yep, and that's correct.
Info, diagnostics, errors - all go to stderr. That is not a big deal in interactive scenarios, the user sees it anyway. If the command's primary objective was to produce something on output, then it would go to stdout.

@faboweb
Copy link
Contributor Author

faboweb commented Oct 30, 2018

From chat:

Fabo [11:33 AM]
That is not a big deal in interactive scenarios, the user sees it anyway.

the user is not a problem, but scripts that need to know if the command is successful or failed.

the newer `gaiad init` command will not print the seeds to the screen

then maybe this is ok. where will it put the seeds? (edited)

alessio [11:34 AM]
@faboweb scripts can now it by reading the process's return code, as per POSIX
the new workflow will be quite different
you will need to create the key first
gaiad init will just create priv_validator.json, node_key.json, config files & genesis.json
then you will run gaiad gentx - by then you will have to have created a key with which sign the gentx (edited)
last but not least - gaiad collect-gentxs

Fabo [11:36 AM]
ok thank you for the explanation.

alessio [11:37 AM]
pleasure - subscribe here if you want to know when we merge it -> #2602

Fabo [11:37 AM]
I am a little concerned about developer friendlyness: chaning the flow from one command to 4

alessio [11:40 AM]
well, gaiad init will be costless, riskless, and flagless too - gaiad gentx and gaiad collect-gentxs could be run with default options too
you will have to add your account to genesis.json once the latter is created
(but I'll be working on a tool for that too)
though yes true, from 1 command to 3

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

No branches or pull requests

2 participants