lightwalletd
lightwalletd copied to clipboard
Accept runtime arguments from environment variables and config files
These will make the server easier to deploy in certain contexts, particularly inside container orchestration systems.
We need more information before we do this, because we need to know what type of load balancer, orchestrator, etc. that people are using.
We could just try to handle all of the commonly things that are used and handle them on an if-basis. (Obviously requires more work)
Should we do this? This would give the user an alternative to command-line arguments, even without regard to load balancing, orchestration, etc. More config options for those things and others can be added later.
This is of course what zcashd does with ~/.zcash/zcash.config
(which we got from bitcoin). I think the format zcashd and bitcoin uses is: https://en.wikipedia.org/wiki/INI_file
We're already using golang package that implements this format: https://github.com/go-ini/ini
We do already use go-ini
for parsing Zcash config files over in the RPC client, so that's not out of our way.
This was more referring to allowing cluster orchestrators to pass port assignments and such through environment variables or mounting a config, whatever is idiomatic. Someone's going to need it someday, but not until they start deploying lots of lightwalletd instances on k8s or marathon or something.
Added an example of this functionality with the cobra and viper packages here https://github.com/zcash-hackworks/lightwalletd/pull/165
I really want to provide alternative for parsing zcash.conf, but feel like this is a first step.