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

refactor(gnoland): add subcommands support #937

Merged
merged 17 commits into from
Jul 10, 2023

Conversation

moul
Copy link
Member

@moul moul commented Jun 29, 2023

BREAKING CHANGE: CLI usage changed for node operators.

  • add subommands support
  • rename gnoland to gnoland server
  • update doc
  • update deployment scripts
  • fix tests, CI/CD
  • add a gnoland init command (won't do now, we need to choose between keeping lazy init in server + having init VS having always to run the two commands because server can't init)

Addresses #731

Checklists...

Contributors Checklist

  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

Maintainers Checklist

  • Checked that the author followed the guidelines in CONTRIBUTING.md
  • Checked the conventional-commit (especially PR title and verb, presence of BREAKING CHANGE: in the body)
  • Ensured that this PR is not a significant change or confirmed that the review/consideration process was appropriate for the change

@moul moul self-assigned this Jun 29, 2023
@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Jun 29, 2023
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
moul added 3 commits June 29, 2023 21:36
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul moul changed the title feat(gnoland): add subcommands support refactor(gnoland): add subcommands support Jun 29, 2023
moul added 2 commits June 29, 2023 22:22
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul moul mentioned this pull request Jun 22, 2023
8 tasks
moul added 2 commits June 30, 2023 06:08
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@moul moul marked this pull request as ready for review June 30, 2023 04:14
@moul moul requested a review from a team as a code owner June 30, 2023 04:14
Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

Code looks OK. What other subcommand would you like to add which would justify having subcommands? (init, in my opinion, could just be a flag...). Mostly asking as I don't think it makes sense to add the need to specify the "server" subcommand, both because it breaks old documentation and because it seems redundant (seeing as the gnoland binary's main "thing" is the server)

@moul
Copy link
Member Author

moul commented Jul 4, 2023

Current status:

  • gnoland --init-only is now gnoland init
  • gnoland is now gnoland server

@albttx explained that it's common to have those subcommands so that managing a node becomes more flexible.
See #731 (comment)

Here is what we have when running a common cosmos-sdk chain (note that it mixes node management, client and other things):

Available Commands:
  add-genesis-account    Add a genesis account to genesis.json
  collect-gentxs         Collect genesis txs and output a genesis.json file
  config                 Create or query an application CLI configuration file
  debug                  Tool for helping with debugging your application
  export                 Export state to JSON
  export-derive-balances Export a derive balances from a provided genesis export
  forceprune             Forceprune option prunes and compacts blockstore.db and state.db.
  gentx                  Generate a genesis tx carrying a self delegation
  get-env                Prints the current environment
  help                   Help about any command
  init                   Initialize private validator, p2p, genesis, and application configuration files
  keys                   Manage your application's keys
  migrate                Migrate genesis to a specified target version
  prepare-genesis        Prepare a genesis file with initial setup
  query                  Querying subcommands
  rollback               rollback tendermint state by one height
  rosetta                spin up a rosetta server
  set-env                Set home environment variables for commands
  staked-to-csv          Export a airdrop csv from a provided balances export
  start                  Run the full node
  status                 Query remote node for status
  tendermint             Tendermint subcommands
  testnet                Initialize files for a simapp testnet
  tx                     Transactions subcommands
  unsafe-reset-all       (unsafe) Remove all the data and WAL, reset this node's validator to genesis state
  validate-genesis       validates the genesis file at the default location or at the location passed as an arg
  version                Print the application binary version information

It would be beneficial to consider adding additional commands such as gnoland doctor or utility functions for working with the store, such as extracting contracts or state.

I will rename server to start, which looks more standard.

Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com>
@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Jul 4, 2023
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Jul 4, 2023
gnovm/cmd/gno/test_test.go Outdated Show resolved Hide resolved
go.mod Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I imagine dep changes also coming from visualizations?

Copy link
Member Author

Choose a reason for hiding this comment

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

what do you mean?

gno.land/cmd/gnoland/root.go Outdated Show resolved Hide resolved
gno.land/cmd/gnoland/start.go Outdated Show resolved Hide resolved
@harry-hov
Copy link
Contributor

Maybe we also need to modify this[1]

-./build/gnoland
+./build/gnoland start

[1] https://github.com/moul/gno/blob/46baeaa8518760dbb56e2b11f96aa6f8a8595b81/gno.land/cmd/gnofaucet/README.md?plain=1#L19

moul and others added 3 commits July 9, 2023 12:16
Co-authored-by: Hariom Verma <hariom18599@gmail.com>
Co-authored-by: Hariom Verma <hariom18599@gmail.com>
@github-actions github-actions bot removed the 📦 🤖 gnovm Issues or PRs gnovm related label Jul 9, 2023
@moul moul merged commit 8c8923e into gnolang:master Jul 10, 2023
@moul moul deleted the dev/moul/gnolang-dev branch July 10, 2023 10:06
@thehowl thehowl mentioned this pull request Jul 10, 2023
10 tasks
@dongwon8247
Copy link
Member

Changed the Developer Portal docs accordingly

Doozers pushed a commit to Doozers/gno that referenced this pull request Aug 31, 2023
Co-authored-by: Hariom Verma <hariom18599@gmail.com>
@moul moul added this to the 💡Someday/Maybe milestone Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related 🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: ✅ Done
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants