feat: add `gnoland init`
Description
This PR introduces a gnoland init command, that initializes the node configuration and secrets.
Closes #1885
Contributors' checklist...
- [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: xxxmessage 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, if any. More info here.
Codecov Report
Attention: Patch coverage is 56.97674% with 74 lines in your changes are missing coverage. Please review.
Project coverage is 45.87%. Comparing base (
bb776f0) to head (fb8bb39).
Additional details and impacted files
@@ Coverage Diff @@
## master #1985 +/- ##
==========================================
- Coverage 49.08% 45.87% -3.21%
==========================================
Files 576 521 -55
Lines 77806 72445 -5361
==========================================
- Hits 38191 33236 -4955
+ Misses 36521 36466 -55
+ Partials 3094 2743 -351
| Flag | Coverage Δ | |
|---|---|---|
| contribs/gnodev | ? |
|
| contribs/gnofaucet | ? |
|
| contribs/gnokeykc | ? |
|
| contribs/gnomd | ? |
|
| gno.land | 61.62% <63.39%> (+0.24%) |
:arrow_up: |
| gnovm | ? |
|
| misc/autocounterd | 0.00% <ø> (ø) |
|
| misc/genproto | 0.00% <ø> (ø) |
|
| misc/genstd | 73.90% <ø> (ø) |
|
| misc/goscan | 0.00% <ø> (ø) |
|
| misc/logos | 17.38% <ø> (ø) |
|
| misc/loop | 0.00% <ø> (ø) |
|
| tm2 | 54.47% <0.00%> (-0.05%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Relates/addresses/continues: #1050, #1102, #1333, #1605.
Before we continue, I'd like to clarify a few points.
Could you please specify the expected behavior and update
docs/?How does
gnoland startfunction in different contexts?
@moul Do you think we should start adding the command docs in this PR, or leave it for #1820?
gnoland init is supposed to initialize the node's secrets and config directory (default) in the given data dir. It currently overlaps with gnoland start, because we still have lazy init functionality in gnoland start (something that will get dropped in #1886).
It is however completely backwards compatible with users that still use only gnoland start (until #1886)
Do you think we should start adding the command docs in this PR, or leave it for https://github.com/gnolang/gno/issues/1820?
Any addition of a subcommand in an official tool should include documentation updates in the same pull request.
gnoland init is supposed to initialize the node's secrets and config directory (default) in the given data dir. It currently overlaps with gnoland start, because we still have lazy init functionality in gnoland start (something that will get dropped in https://github.com/gnolang/gno/issues/1886).
OK, thx.
It is however completely backwards compatible with users that still use only gnoland start (until https://github.com/gnolang/gno/issues/1886)
Ok, great. Please wait for a discussion before starting #1886.
@moul @leohhhn
I've added the initial gnoland init documentation:
6575bf8
I've also noticed that our gnoland tooling documentation is completely outdated, so we have created a task for tackling this in a separate PR:
https://github.com/gnolang/gno/issues/1987
Here is what the docs page looks like:
Could you place "init" before "start" in the gnoland -h command?
Ensure that the documentation begins with a suggested flow, starting with "init" and then "start," rather than delving into technical details and parameters right away.
Your documentation is well-written, but it focuses on advanced scenarios. We should prioritize having essential documentation come first.
@moul
Could you place "init" before "start" in the
gnoland -hcommand?
I was under the impression that ffcli sorts the subcommands alphabetically for whatever reason (regardless of how we add subcommands), but that thankfully isn't the case, so I've swapped the order:
Ensure that the documentation begins with a suggested flow, starting with "init" and then "start," rather than delving into technical details and parameters right away.
Your documentation is well-written, but it focuses on advanced scenarios. We should prioritize having essential documentation come first.
Are you suggesting I add something additional to the gnoland binary reference page, or create a new tutorial that utilizes gnoland init and gnoland start?
We will fill out the gnoland binary page with much more additional content in a PR that tackles #1987
I recommend focusing on documenting workflows. We should ensure including gnoland --help output in an advanced section using an automated tool. The main documentation gap is tool usage and getting started, which should be human-written.
Consider renaming your page to "Start a Gnoland Node" for clarity. Begin with a simple case and progress to advanced cases later, if needed.
@moul @leohhhn
I've updated the existing node start documentation to include the changes applied in this PR (as well as the new flow): 3bc320f
I noticed a small bug in InitChainer, so I fixed it as well in this commit
For more detailed docs, I will leave it to #1820
Just took code overview, seems nice ( I'm testing with actual binary now ).
Found one small minor thing, which is -skip-start flag with gnoland start.
I think it can be remove it as we discussed from here since gnoland init does init.
Status of this PR:
- I need to drop
skip-startas pointed out by @r3v4s, I completely forgot about this 🤦♂️ - @moul needs to take a look at the docs in this PR and give feedback :)