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

Document some gnoland flags require -lazy #2443

Open
grepsuzette opened this issue Jun 26, 2024 · 0 comments · May be fixed by #2444
Open

Document some gnoland flags require -lazy #2443

grepsuzette opened this issue Jun 26, 2024 · 0 comments · May be fixed by #2444
Labels
📖 documentation Improvements or additions to documentation

Comments

@grepsuzette
Copy link
Contributor

Description

Initially thought it was #2391 but it's a bit different.

When you initialize a new chain manually with gnoland, without -lazy, -genesis-balances-file and -genesis-txs-file are then totally ignored.
Yet the -help doesn't mention this.

Diagnostic

In https://github.com/gnolang/gno/blob/f74e5f0554d1604c94f9dcad5b126c55f1e52ff1/gno.land/cmd/gnoland/start.go

genesisBalancesFile is only used here:

func generateGenesisFile(genesisFile string, pk crypto.PubKey, c *startCfg) error {
	gen := &bft.GenesisDoc{}
	gen.GenesisTime = time.Now()
	gen.ChainID = c.chainID
	(...)

	// Load balances files
	balances, err := gnoland.LoadGenesisBalancesFile(c.genesisBalancesFile)  // HERE
	if err != nil {
		return fmt.Errorf("unable to load genesis balances file %q: %w", c.genesisBalancesFile, err)  // HERE
	}

And generateGenesisFile only ever gets called here:

// lazyInitGenesis a new genesis.json file, with a signle validator
func lazyInitGenesis(...) error {
	// Check if the genesis.json is present
	if osm.FileExists(genesisPath) {
		return nil
	}

	// Generate the new genesis.json file
	if err := generateGenesisFile(genesisPath, publicKey, c); err != nil {  // CALLED HERE

We must better document -genesis-balances-file in the command, and probably fail when this option is called without -lazy.

Same observation for -genesis-txs-file

@grepsuzette grepsuzette changed the title Some gnoland start flags require -lazy Document some gnoland flags require -lazy Jun 26, 2024
grepsuzette added a commit to grepsuzette/gno that referenced this issue Jun 26, 2024
This PR simply documents a constraint, addressing gnolang#2443

When you use `gnoland start` with the following options:

-genesis-txs-file
-genesis-balances-file

Even if your gnoland was never launched (height 0),
they require -lazy to have any kind of effect.
grepsuzette added a commit to grepsuzette/gno that referenced this issue Jun 26, 2024
This PR simply documents a constraint, addressing gnolang#2443

When you use `gnoland start` with the following options:

-genesis-txs-file
-genesis-balances-file

Even if your gnoland was never launched (height 0),
they require -lazy to have any kind of effect.
@Kouteki Kouteki added the 📖 documentation Improvements or additions to documentation label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation
Projects
Development

Successfully merging a pull request may close this issue.

2 participants