DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.23k stars 2.03k forks source link

Config management problems + interest for PR ? #573

Open JonRiv opened 7 years ago

JonRiv commented 7 years ago

Hello,

I read a lot of users are wondering how to connect to different accounts, and also people wondering why there are heavy differences between sim and trade behavior.

There is a @zenbot:conf object that is loaded with either sample-conf.js or conf.js in boot.js, and then requested with the get('conf') method. The problem is that this object doesn't take into account command parameters (including the --conf one), which results in different configurations depending on the modules implementation.

Some only request the global object (exchanges), when others parse command options to update it (trade/sim). In this case there is also the problem of --conf file rewriting other command options, while NOT rewriting the ones in @zenbot:conf, hence NO multiple accounts).

I think the default behavior should be :

sample-conf.js => conf.js => --conf file => command options

What do you think, if you are interested I can clean up my local patch and submit a PR.

Best,

DeviaVir commented 7 years ago

I think a PR is always welcome, it's also usually easier to reason about code than about words, at least for me.

haxwell commented 6 years ago

@JonRiv Hey, could you see if PR #912 addresses this issue for you?

JonRiv commented 6 years ago

I think it does, at least the part allowing multiple configuration files.

As far as I remember, the modules (trade, sim) were also managing their own config which is a problem you can not solve from boot.js only.

DeviaVir commented 6 years ago

Can you check if that is still the case after the recent changes in unstable?