to:
cc: @subspacecommunity/subspace-maintainers
related to:
resolves:
Background
We have some parameters which are passed on the command line and some which are read from environment variable.
And we have to know which is which. There is also no centralized location where all the start up config is documented.
This PR uses the Cobra library in conjunction with the Viper library to unify all of our startup configuration.
It still does not support all of the configuration from the command line (it's too much). But anything that can be configured from the command line can be configured instead from either a config file or an environment variable. Or a combination of all of these.
I've taken care to keep all environment variables and command line parameters as they were. But this PR is nonetheless a breaking change. Go cli library uses one dash for options, wherein Cobra, like other unix tools, uses double dash for options.
to: cc: @subspacecommunity/subspace-maintainers related to: resolves:
Background
We have some parameters which are passed on the command line and some which are read from environment variable. And we have to know which is which. There is also no centralized location where all the start up config is documented.
This PR uses the Cobra library in conjunction with the Viper library to unify all of our startup configuration. It still does not support all of the configuration from the command line (it's too much). But anything that can be configured from the command line can be configured instead from either a config file or an environment variable. Or a combination of all of these.
I've taken care to keep all environment variables and command line parameters as they were. But this PR is nonetheless a breaking change. Go cli library uses one dash for options, wherein Cobra, like other unix tools, uses double dash for options.
Testing
I've added some basic tests.