Add support for reading multiple config.ini files
This will enable the user to have a config.ini file with only the variables they have customized, and the bot will fall back to its config.ini.example file for other variables. We can also have a per-exchange config file if needed, etc.
This could also be solved with using .php file as config with calls to env() function in them. So every user can have their own .env file to overwrite default settings.
Example:
return [
'poloniex' => [
'enabled' => env('POLONIEX_ENABLED', false),
'api_secret' => ....
],
....
];
I prefer to keep the format of the config files INI for two reasons, one is security (since I plan changes in the future to allow the bots to download configurations from a remote server) and two is forward compatibility with future versions of the bot not written in PHP. The current PHP version is probably going to be (at least partially) replaced with parts written in other languages...
Also note that environment variables aren't that much of a suitable match for our needs here since the bot supports changing its configuration variables without restarting, something that isn't normally supported through environment variables.
Nice, I didn't know that config can be changed mid-run. Do you already have any ideas which languages are you aiming at?
I think some Python or Node depending on the exchange SDKs etc. used where we need to interface with such libraries, and Rust for everything else. We'll see, basically the right tool for the right part of the system.
Good choice, cctx is on both Python and Node.