ChainSafe / ChainSafe/gossamer
Gossamer persists default config and CLI flags in config file
- Dominant language
- Go
- Stars
- 454
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the bug
Gossamer writes its current configuration to a config file without being asked to do so.
## Expected Behavior
When the node is run with a certain CLI flag, the value of that flag is applied to the configuration of the running process.
When the node is run again, without passing this CLI flag, the configuration value is taken from the config file or its default value.
## Current Behavior
When the node is run with a certain CLI flag, the value of that flag is applied to the configuration of the running process and the config file is overwritten with the same config.
When the node is run again, without passing this CLI flag, the previously passed value is read from the config file and applied.
## Possible Solution
Don't write a configuration file.
## To Reproduce
Steps to reproduce the behaviour:
1. run `gossamer` and terminate the process
2. run `grep peers config/config.toml` in the gossamer data directory and note the value of min peers
3. run `gossamer --min-peers N` with an N that is not the number from step 2 and terminate the process
4. run `grep peers config/config.toml` in the gossamer data directory and find the value of min peers to be the one passed in step 3
Contributor guide
Assessment
This issue has not been assessed yet.