-
Notifications
You must be signed in to change notification settings - Fork 378
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(cmd/gnoland): cli implement --home #2355
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2355 +/- ##
==========================================
- Coverage 54.99% 54.96% -0.04%
==========================================
Files 595 595
Lines 79775 79718 -57
==========================================
- Hits 43872 43815 -57
Misses 32581 32581
Partials 3322 3322
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After doing a node deployment myself, I agree this is a good way to go, as for using genesis.json I've had to do quite a bit of a sing and dance to get it working.
cc @sw360cab for his first review :)
type rootCfg struct { | ||
homeDir homeDirectory | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, for flag structs, don't nest them. They can have a helper type like the one you created, but there shouldn't be 3 levels of nesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to understand how you want it not nested ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I don't know, I had a bit of a think and discussion with Milos and I'm not sure how this should work. cc @zivkovicmilos
I don't like rootCfg
🤷
@thehowl @zivkovicmilos it's rebased and i fixed your reviews |
@@ -184,24 +126,24 @@ func TestSecrets_Verify_All_Missing(t *testing.T) { | |||
initArgs := []string{ | |||
"secrets", | |||
"init", | |||
"--data-dir", | |||
tempDir, | |||
"--home", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use a single flag, I think we should use —data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it could lead to confusions, because the folder contains datas, configurations, secrets...
@@ -28,7 +28,6 @@ func NewRootCmdWithBaseConfig(io commands.IO, base BaseOptions) *commands.Comman | |||
ShortUsage: "<subcommand> [flags] [<arg>...]", | |||
LongHelp: "Manages private keys for the node", | |||
Options: []ff.Option{ | |||
ff.WithConfigFileFlag("config"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because --config
is replaced with --home
, which is not a file
Adding genesis, config, and secret commands to the gnoland command was not the best move. They belong in a separate tool like The gnoland binary is meant to be a stable, finished product, not an SDK for running multiple blockchains. We're not going to be tweaking genesis files daily. Gno.land will have its mainnet, testnets, and a local setup that's either lazy or uses the latest snapshot. Other projects might create their own lands, but they won't be using the gnoland binary for that. Most of the configuration will be managed by the chain too. In other words, 99.9% of people will use lazy or download a ready-to-start state. Here's what we really need:
|
@moul I understand what you means, but i really think those commands are required from an ops perspective. Creating a genesis file for a multi node cluster with You already told me this commands will come in a about the rename from |
This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months. |
This implement the point 2️⃣ and 4️⃣ in my wishlist (#2102)
This PR implement a new flag
--home
and remove multiple flags like:--output-path
or--data-dir
,--config-path
which could be confusing while usinggnoland
binary.All config is under the directory specified by
--home
{{ --home }}/genesis.json
🎉Examples:
gnoland genesis generate --output-path $GENESIS_FILE
gnoland config set --config-path ./gnoland-data/config/config.toml rpc.laddr "tcp://0.0.0.0:26657"