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

[chain] move gnoland start's genesis generation to cmd/genesis #1952

Open
thehowl opened this issue Apr 18, 2024 · 5 comments
Open

[chain] move gnoland start's genesis generation to cmd/genesis #1952

thehowl opened this issue Apr 18, 2024 · 5 comments

Comments

@thehowl
Copy link
Member

thehowl commented Apr 18, 2024

Master issue: #1836;
From this issue comment: #1836 (comment)

At the moment, the gno.land node uses the generateGenesisFile function to set up the genesis file, including transactions, genesis balances and also the packages and realms in the examples/ directory.

Ideally, this step of genesis generation should be delegated to the genesis command; so that gnoland start only ever has to concern itself with starting the node proper. The long-term vision is that the Gno.land node should be able to run without needing a "root directory" (ie. being placed in the monorepo's directory structure).

Proposed DoD

  • Create genesis packages, with subcommands to:
    • list all addpkg transactions (what packages will be created at genesis)
    • get an addpkg transaction, filtering by pkgpath, showing the contents as well.
    • del an addpkg transaction, filteriing by pkgpath.
    • add to add a directory containing packages (ie. gnoland add examples or gnoland add examples/gno.land/p/demo/avl)
      • NOTE: this should place packages taking care to load them in their "dependency order" using gno.mod; ie. what generateGenesisFile is doing right now.
    • clear to remove all addpkg transactions.
  • Move the default genesis transactions and balances files to a default.genesis.json
    • Balances can already be easily manipulated using genesis balances, so they don't need to have separate files
  • Create a makefile recipe to easily set up a genesis.json, combining default.genesis.json with genesis clear; genesis add ../examples.

@zivkovicmilos Question: do we plan a gnoland init command? (combining config init + secrets init?). If so, should genesis clear; genesis add ../examples be a part of it?

@zivkovicmilos
Copy link
Member

@zivkovicmilos Question: do we plan a gnoland init command? (combining config init + secrets init?). If so, should genesis clear; genesis add ../examples be a part of it?

Most def: #1885

I see no reason why not, since gnoland init will just be the default initialization ✅

@Kouteki
Copy link
Contributor

Kouteki commented May 15, 2024

@harry-hov what's the status for this issue? #1988 is related but doesn't resolve this one.

@harry-hov
Copy link
Contributor

@Kouteki #1988 is the first step in the direction of solving this issue. Further work will be done on top of it.

@Kouteki Kouteki assigned zivkovicmilos and unassigned harry-hov Jun 7, 2024
zivkovicmilos added a commit that referenced this issue Jun 11, 2024
## Description

This PR introduces the ability to specify a package directory that will
recursively be added (deployed) to the `genesis.json`, utilizing the
existing `gnoland genesis txs add` command.

It also separates out the logic from `gnoland genesis txs add` into:
- `gnoland genesis txs add sheets` for individual tx sheet files (ex.
from tx-archive output)
- `gnoland genesis txs add packages` for recursively adding packages
(ex. `examples`)


![sample](https://github.com/gnolang/gno/assets/16712663/e88b363f-2911-454e-8002-46ee4cbecde6)

Related:
- #1952 
- #1988

<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>

---------

Co-authored-by: Guilhem Fanton <8671905+gfanton@users.noreply.github.com>
@zivkovicmilos zivkovicmilos moved this from Todo to In Progress in 🧙‍♂️gno.land core team Jun 12, 2024
@ajnavarro ajnavarro self-assigned this Jun 14, 2024
@zivkovicmilos
Copy link
Member

@Kouteki
We have finished the scope of this task that we needed for test4, the leftover scope is left over for a subsequent rolling release

I've moved the milestone to post launch

@thehowl
Copy link
Member Author

thehowl commented Oct 31, 2024

We need to figure out what to do with this now (following #2824) cc @zivkovicmilos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

5 participants