-
Notifications
You must be signed in to change notification settings - Fork 6
ADR 5 cardano testnet node configuration file
📜 Proposed 2024-09-10
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 command in cardano-cli
that takes a node configuration file as parameter and performs sanity checks:
- The configuration file can be loaded.
- Paths of genesis files are specified.
- Hashes of genesis files are specified and are correct.
We considered having a flag that would make check-node-configuration
:
- Fill the hashes of genesis files if missing
- Fix the hashes of genesis files if present but wrong
However, in the end, we favored having a pure command (i.e. a command that doesn't modify things) so we ruled such a fixup flag.
We considered having create-testnet-data
create a default node configuration file, and populating it with the paths and hashes of genesis files. This could have been nice to users, but it is complicated to implement, because most of the types for the node configuration file live in cardano-node
, as for example the NodeConfiguration
type which lives in cardano-node/src/Cardano/Node/Configuration/POM.hs. The NodeConfig
type which we have in cardano-api
(see cardano-api/internal/Cardano/Api/LedgerState.hs) for the node configuration file is not general enough to create a full-fledged node configuration file.
However, moving the NodeConfiguration
type and its accompanying types to cardano-api
is a large endeavor, which was not given priority yet. It is a large endeavor for two reasons: NodeConfiguration
has many fields of different types and it is quite different from NodeConfig
. NodeConfig
contains the bare minimum needed for API specific operations: it is mostly concerned with genesis files and their hashes.
This will allow users of testnets to check their node configuration file before starting their testnet, and so they will catch errors earlier and faster.
The cardano-node
wiki has moved. Please go to (https://github.com/input-output-hk/cardano-node-wiki/wiki) and look for the page there.