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

feat: add genesis command suite #1252

Merged
merged 14 commits into from
Oct 28, 2023
Merged

feat: add genesis command suite #1252

merged 14 commits into from
Oct 28, 2023

Conversation

zivkovicmilos
Copy link
Member

@zivkovicmilos zivkovicmilos commented Oct 18, 2023

Description

This PR introduces the genesis.json command suite, as outlined in #1203.

Closes #1203 and #1189

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.

@zivkovicmilos zivkovicmilos added the 🌱 feature New update to Gno label Oct 18, 2023
@zivkovicmilos zivkovicmilos self-assigned this Oct 18, 2023
@github-actions github-actions bot added 📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related labels Oct 18, 2023
@zivkovicmilos zivkovicmilos linked an issue Oct 18, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e10f811) 47.81% compared to head (766cd91) 47.91%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1252      +/-   ##
==========================================
+ Coverage   47.81%   47.91%   +0.10%     
==========================================
  Files         369      372       +3     
  Lines       62742    63019     +277     
==========================================
+ Hits        29997    30195     +198     
- Misses      30293    30366      +73     
- Partials     2452     2458       +6     
Files Coverage Δ
tm2/pkg/bft/types/genesis.go 86.04% <100.00%> (+7.09%) ⬆️
tm2/pkg/bft/types/params.go 90.69% <100.00%> (ø)
tm2/pkg/crypto/keys/client/add.go 31.08% <100.00%> (-0.29%) ⬇️
tm2/pkg/crypto/keys/client/helper.go 57.14% <100.00%> (ø)

... and 33 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

## Description

This PR adds the `genesis verify` subcommand.

Closes #1229

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
## Description

This PR adds support for the `genesis validator` sub-commands, as
outlined in #1228.

Closes #1228 

Example `genesis validator add` command you can use to test out the
functionality:
```bash
genesis validator add --name milos -pub-key gpub1pgfj7ard9eg82cjtv4u4xetrwqer2dntxyfzxz3pqvknvnspy43c9zp0ts7wgvupldfzkws8kmvvz2eelfmzzupfymwpwzhh9m3 -address g1wpewvuxtyvqqwysndt4f8425tpdg3lf0mhu6fm
```
<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
## Description

This PR introduces the `genesis balances` subcommand, as outlined in
#1230.

Closes #1230 

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
- [x] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
@zivkovicmilos zivkovicmilos marked this pull request as ready for review October 25, 2023 22:08
@zivkovicmilos zivkovicmilos requested review from a team, jaekwon and moul as code owners October 25, 2023 22:08
gno.land/cmd/genesis/txs.go Outdated Show resolved Hide resolved
Copy link
Member

@gfanton gfanton left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Just a few points, but they're not mandatory for me.
Generally speaking, I prefer having mandatory flags as direct arguments when there aren't too many. It feel more natural to me

gno.land/cmd/genesis/txs_add.go Outdated Show resolved Hide resolved
gno.land/cmd/genesis/txs_remove.go Outdated Show resolved Hide resolved
gno.land/cmd/genesis/generate.go Outdated Show resolved Hide resolved
@zivkovicmilos
Copy link
Member Author

@moul @gfanton

I've anticipated the functionality where we'd need to actually export existing genesis balances / transactions (for use in various tools), so I've added this functionality:

@moul moul merged commit 6ba4f74 into master Oct 28, 2023
175 of 176 checks passed
@moul moul deleted the feat/genesis branch October 28, 2023 21:29
gfanton pushed a commit to gfanton/gno that referenced this pull request Nov 9, 2023
## Description

This PR introduces the genesis.json command suite, as outlined in gnolang#1203.

Closes gnolang#1203 and gnolang#1189

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
moul pushed a commit to moul/gno that referenced this pull request Nov 14, 2023
## Description

This PR introduces the genesis.json command suite, as outlined in gnolang#1203.

Closes gnolang#1203 and gnolang#1189

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
thehowl pushed a commit that referenced this pull request Mar 12, 2024
## Description

Based on discussions in #1593, this PR introduces the CLI suite for
manipulating the `config.toml`. Using this suite, we can build better
workflows for power users.

This PR is a series of lego blocks that are required for us to get a
normal user chain connection going:
- #1252 - solved `genesis.json` management and manipulation
- #1593 - solved node secrets management and manipulation
- this PR - solves `config.toml` management and manipulation

All of these PRs get us to a point where the user can run:
- `gnoland init`
- `gnoland start`

to get up and running with any Gno network. The added middle step is
fine-tuning the configuration and genesis, but it's worth noting this
step is optional.

New commands:
```shell
gnoland config --help             
USAGE
  config <subcommand> [flags]

Gno config manipulation suite, for editing base and module configurations

SUBCOMMANDS
  init  Initializes the Gno node configuration
  set   Edits the Gno node configuration
  get   Shows the Gno node configuration
```

In short, the `gnoland config init` command initializes a default
`config.toml`, while other subcommands allow editing
 viewing any field in the specific configuration.

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
albttx pushed a commit to albttx/gno that referenced this pull request Mar 15, 2024
## Description

Based on discussions in gnolang#1593, this PR introduces the CLI suite for
manipulating the `config.toml`. Using this suite, we can build better
workflows for power users.

This PR is a series of lego blocks that are required for us to get a
normal user chain connection going:
- gnolang#1252 - solved `genesis.json` management and manipulation
- gnolang#1593 - solved node secrets management and manipulation
- this PR - solves `config.toml` management and manipulation

All of these PRs get us to a point where the user can run:
- `gnoland init`
- `gnoland start`

to get up and running with any Gno network. The added middle step is
fine-tuning the configuration and genesis, but it's worth noting this
step is optional.

New commands:
```shell
gnoland config --help             
USAGE
  config <subcommand> [flags]

Gno config manipulation suite, for editing base and module configurations

SUBCOMMANDS
  init  Initializes the Gno node configuration
  set   Edits the Gno node configuration
  get   Shows the Gno node configuration
```

In short, the `gnoland config init` command initializes a default
`config.toml`, while other subcommands allow editing
 viewing any field in the specific configuration.

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🌐 tendermint v2 Issues or PRs tm2 related 📦 ⛰️ gno.land Issues or PRs gno.land package related 🌱 feature New update to Gno
Projects
Status: Done
Status: 🚀 Needed for Launch
Status: Done
Archived in project
Development

Successfully merging this pull request may close these issues.

[META] Genesis Management PoC for Genesis Manipulation Libraries and Tools
3 participants