Closed teast21 closed 1 year ago
Adding some context:
An attempt was made to run the command kindelia node start --mine
and this resulted in the error:
Error: Could not find prop 'node.networks.0xCAFE0004.initial_peers' in config file.
After running kindelia node init
the error didn't happen again.
What probably happened:
Some time ago, a version of kindelia that contained a default configuration file that did not include the node.networks.<network_id>
property was run by the user. This version created the $HOME$/.kindelia
folder and placed the kindelia.toml
file in it with the default values and without this property. But after the breaking changes made in 1eef727 and c8f5af2, the kindelia cli expects this property to exist.
I think that in order to solve this problem an error that better explains the situation can be shown to the user, one which indicates that there is probably something wrong with the configuration file, and which suggests the insertion of this property manually or the creation of a new configuration file with kindelia init
command.
Another possibility, but a more "strange" one, would be to try to automatically insert these missing values, in case a property is not found in the configuration file, accompanied by a warning which would says that this operation is being done.
yeah, I think the error message is relatively clear. It identifies the exact setting that can't be found. And this should only affect anyone who has a config file from before these commits.... ie a developer or super early adopter/tester. or someone who manually removes all networks from config sometime after init is run.
In other words, I don't really think its an issue that needs fixing.
A more friendly error and a print indicating the path of the considered configuration file have been added in 5548bea
Kindelia init seems to improperly create the config file
per discussion here: https://discord.com/channels/912426566838013994/912426569618829417