-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add ADR for checking node configuration files with cardano-cli #52
base: main
Are you sure you want to change the base?
Conversation
758baab
to
d63ec19
Compare
|
||
# Context | ||
|
||
There is no canonical way to create a node configuration file. `cardano-cli` offers this possibility as part of the bigger [create-cardano](https://github.com/IntersectMBO/cardano-cli/blob/551d9b9f2f244e0d681bf03eaa6d985565ac3a5b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_genesis_create-cardano.cli#L49) command, but this is ad-hoc. |
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.
Can you highlight more status quo here?
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.
In the end I didn't, because the scope changed: we only check the configuration file, we don't create it.
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 don't think we should have a command to create a node configuration file as we will be repeating ourselves in a sense (why not just create the config file to begin with?). On the other hand a command that checks a node config file for the user would be handy. For example:
- The files listed do exist (and can be successfully decoded?)
- The mandatory configuration values are set
|
||
Introduce a new `conway genesis check-node-config file` command in `cardano-cli`. It will have the following options: | ||
|
||
``` |
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 list the options again? It should just check the existence of filepaths and that the genesis file hashes are correct. Have a look at the other fields that it may make sense to have checks for as well but to re-enter the file paths doesn't make sense imo. Parameterizing it on the era makes sense because things can change era to era and notifying the user what they may be missing in an upcoming era would be useful.
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.
Yes, actually this was an earlier design and the actual WIP work (this branch) has the following API:
cardano-cli debug check-node-configuration
--node-configuration-file FILEPATH
[--fix-configuration-file]
Updating the ADR accordingly right now 👍
|
||
## Have `create-testnet-data` create the node configuration file | ||
|
||
1. Have `create-testnet-data` create a default node configuration file (populating it with the paths and hashes of the genesis files). |
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.
👍
66c8c3a
to
6251410
Compare
6251410
to
40f7066
Compare
1210aa6
to
e977968
Compare
|
||
# Context | ||
|
||
There is no way to check a node configuration file for basic sanity issues. |
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.
Can you describe the risks and who is affected by not checking the configuration file?
I see that you described it in the Consequences, but I think it belongs more to the Context.
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.
Good point 👍
Adding more details in the Context section:
# Context
-There is no way to check a node configuration file for basic sanity issues.
+There is no way to check a node configuration file for basic sanity issues. This is a problem for people running testnets, because they will only discover _after having started their testnet_ that something is wrong (because the node will refuse to start). And starting a testnet is a costly operation, meaning the failures will only happen after tenth of seconds; causing the feedback loop to be slow.
Introduce a new `debug check-node-configuration FILEPATH` command in `cardano-cli`. It will have the following options: | ||
|
||
``` | ||
--node-configuration-file FILEPATH |
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 would avoid listing the command names and option names. Those are parts of the user interface design, and not really n part of an architecture. Additionally, the commands and option names can change during the time and the ADR will be out of sync.
If you insist on keeping the command and option names, can you rephrase the text to make them examples rather than a references to a command option / toggle?
For example instead of
Have a
--fix
flagWe considered having a
--fix
flag that would makecheck-node-configuration
:
write
Provide fix up capability
We considered having a dedicated flag (e.g.
--fix
) that would make the command:
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.
@carbolymer> good point 👍
I addressed your concerns in the additional commit Do not give exact API in the ADR. Make it more high-level.
e977968
to
b6b05ce
Compare
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 ok with this. 👍🏻
I remember there was a brief discussion about parsing of node config files, where the datatypes should lie and what's the difference between the cardano-node parsing of config file and what's done in api/cli. If there were conclusions, they would be worth adding here I think.
ADR explaining how we came up with the CLI's
check-node-configuration
command.I've left the various commits to allow reviewers to see the decision's history, but I will squash before merging.