lightwalletd icon indicating copy to clipboard operation
lightwalletd copied to clipboard

Accept runtime arguments from environment variables and config files

Open gtank opened this issue 6 years ago • 4 comments

These will make the server easier to deploy in certain contexts, particularly inside container orchestration systems.

gtank avatar Dec 15 '18 19:12 gtank

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)

lindanlee avatar Jul 10 '19 19:07 lindanlee

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

LarryRuane avatar Oct 30 '19 19:10 LarryRuane

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.

gtank avatar Nov 01 '19 23:11 gtank

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.

benzcash avatar Jan 08 '20 15:01 benzcash