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

R4R: various improvements to gaiad gentx/init #3498

Merged
merged 6 commits into from
Feb 6, 2019

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Feb 5, 2019

Closes: #3497

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Feb 5, 2019

Codecov Report

Merging #3498 into develop will decrease coverage by 0.05%.
The diff coverage is 30.76%.

@@             Coverage Diff             @@
##           develop    #3498      +/-   ##
===========================================
- Coverage    55.43%   55.38%   -0.06%     
===========================================
  Files          141      141              
  Lines        10405    10408       +3     
===========================================
- Hits          5768     5764       -4     
- Misses        4297     4304       +7     
  Partials       340      340

@alessio alessio requested a review from sunnya97 February 5, 2019 01:24
cmd/gaia/init/gentx.go Outdated Show resolved Hide resolved
cmd/gaia/init/gentx.go Outdated Show resolved Hide resolved
@@ -46,11 +45,11 @@ func displayInfo(cdc *codec.Codec, info printInfo) error {
// nolint
func InitCmd(ctx *server.Context, cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: "init",
Use: "init <moniker>",
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we use [...] ?

Copy link
Member

Choose a reason for hiding this comment

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

++

Copy link
Contributor Author

Choose a reason for hiding this comment

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

grep -rw Use: would show how inconsistent our approach has been so far. I'm ok with [moniker] though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed

Copy link
Member

Choose a reason for hiding this comment

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

We need to unify the approach here.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah idc really about either, just as long as we're consistent.

@@ -14,6 +14,7 @@ BREAKING CHANGES
- [\#3465](https://github.com/cosmos/cosmos-sdk/issues/3465) `gaiacli rest-server` switched back to insecure mode by default:
- `--insecure` flag is removed.
- `--tls` is now used to enable secure layer.
- [\#3497](https://github.com/cosmos/cosmos-sdk/issues/3497) `gaiad init` now takes moniker as required arguments, not as parameter.
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we also audit the other modules and also move anything from required flags to args? I think this could be 1 PR. We could also do a number for simplicity...

Copy link
Member

@jackzampolin jackzampolin left a comment

Choose a reason for hiding this comment

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

Once @alexanderbez's comments are addressed I'm good for a 👍 on this. But I think we should also address all the other places in our codebase where the use required flags (I'm looking at slashing/staking/dist tx commands specifically). Maybe in a followup PR?

@alessio
Copy link
Contributor Author

alessio commented Feb 5, 2019

@jackzampolin I'd be happy to revisit commands under x/ modules in a separate PR

Plus, make gaiad init's --moniker turn
into a required argument.

closes: #3497
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

LGTM -- one minor change though. Also, CI is failing.

docs/gaia/join-testnet.md Outdated Show resolved Hide resolved
@@ -19,11 +19,11 @@ These instructions are for setting up a brand new full node from scratch.
First, initialize the node and create the necessary config files:

```bash
gaiad init --moniker <your_custom_moniker>
gaiad init <your_custom_moniker>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we consider using the node's hostname as the default moniker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. Will amend accordingly

Copy link
Member

Choose a reason for hiding this comment

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

Also make this arg optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change of heart: I'd address this in a separate PR, if you don't mind.

alexanderbez and others added 2 commits February 5, 2019 14:20
Co-Authored-By: alessio <quadrispro@ubuntu.com>
@alessio
Copy link
Contributor Author

alessio commented Feb 6, 2019

ACKing sunny's commit.

@@ -164,6 +169,7 @@ following delegation and commission default parameters:
cmd.Flags().String(client.FlagOutputDocument, "",
"write the genesis transaction JSON document to the given file instead of the default location")
cmd.Flags().String(cli.FlagIP, ip, "The node's public IP")
cmd.Flags().String(cli.FlagNodeID, "", "The node's NodeID")
Copy link
Member

Choose a reason for hiding this comment

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

can we default this to the node ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea

@jackzampolin jackzampolin merged commit df94f52 into develop Feb 6, 2019
@jackzampolin jackzampolin deleted the alessio/3497-gentx branch February 6, 2019 04:57
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.

5 participants