arbbot icon indicating copy to clipboard operation
arbbot copied to clipboard

Add support for reading multiple config.ini files

Open cryptoeax opened this issue 8 years ago • 5 comments

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.

cryptoeax avatar Jan 11 '18 22:01 cryptoeax

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' => ....
    ],
    ....
];

sigismund avatar Jan 15 '18 07:01 sigismund

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.

cryptoeax avatar Jan 16 '18 19:01 cryptoeax

Nice, I didn't know that config can be changed mid-run. Do you already have any ideas which languages are you aiming at?

sigismund avatar Jan 17 '18 07:01 sigismund

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.

cryptoeax avatar Jan 17 '18 19:01 cryptoeax

Good choice, cctx is on both Python and Node.

ericfraselle avatar Jan 18 '18 07:01 ericfraselle