brndnmtthws / optimal-buy-cbpro

Scheduled buying of BTC, ETH, and LTC from Coinbase Pro, optimally!
The Unlicense
333 stars 68 forks source link

Coin address #13

Closed coulterj closed 6 years ago

coulterj commented 6 years ago

In the instructions it says we need to copy the files over and edit them to our preferences. I don't see where to edit the coin address like there were on previous releases. Is the option still '--btc-addr' ?

coulterj commented 6 years ago

Can you give an example on what to put in the --coins option? I am trying to figure out how to give BTC/ETH an 80/20 weight and give the withdrawal addresses. It seems that maybe it is missing from the instructions.

brndnmtthws commented 6 years ago

Currently there is no option to adjust the weights; the script weights coins by market cap.

coulterj commented 6 years ago

Ok, can you give an example on how to use the --cons option?

For example if I use something like: -- coins BTC 3bitcoinaddressxxxxx

I receive an error

brndnmtthws commented 6 years ago

There's an option in the README here: https://github.com/brndnmtthws/optimal-buy-gdax#configuration (toward the bottom). It needs to be properly formatted JSON.

example:

optimal-buy-gdax --coins='{"BTC":{"name":"Bitcoin","withdrawal_address":"bc1qc7slnotarealbech32address","external_balance":1000}}'
coulterj commented 6 years ago

Thanks! I will try it out when I get home from work in a few hours.

coulterj commented 6 years ago

Ok, it seems to work with just one coin. When I add Eth, it is throwing an error. Any idea what is wrong with my string?

--coins='{"BTC":{"name":"Bitcoin","withdrawal_address":"BitcoinAddress","external_balance":0}},{"ETH":{"name":"Ethereum","withdrawal_address":EtherAddress,"external_balance":0}}'

brndnmtthws commented 6 years ago

Perhaps you're missing quotes around the ETH address?

coulterj commented 6 years ago

Updated the string to include quotes and now with this string --coins='{"BTC":{"name":"Bitcoin","withdrawal_address":"BitcoinAddress","external_balance":0}},{"ETH":{"name":"Ethereum","withdrawal_address":"EtherAddress","external_balance":0}}'

I get the following error

`● optimal-buy-gdax-buy.service - optimal-buy-gdax-buy Loaded: loaded (/etc/systemd/system/optimal-buy-gdax-buy.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2018-06-06 18:20:26 CDT; 2s ago Process: 7290 ExecStart=/usr/bin/docker run --name optimal-buy-gdax -v /var/lib/optimal-buy-gdax:/usr/src/app/state brndnmtthws/optimal-buy-gda Process: 7278 ExecStartPre=/usr/bin/docker pull brndnmtthws/optimal-buy-gdax:v1.0.4 (code=exited, status=0/SUCCESS) Process: 7271 ExecStartPre=/usr/bin/docker rm optimal-buy-gdax (code=exited, status=0/SUCCESS) Process: 7257 ExecStartPre=/usr/bin/docker stop optimal-buy-gdax (code=exited, status=0/SUCCESS) Main PID: 7290 (code=exited, status=1/FAILURE) CPU: 174ms

Jun 06 18:20:25 btcNode docker[7290]: File "./optimal-buy-gdax.py", line 73, in Jun 06 18:20:25 btcNode docker[7290]: coins = json.loads(args.coins) Jun 06 18:20:25 btcNode docker[7290]: File "/usr/local/lib/python3.6/json/init.py", line 354, in loads Jun 06 18:20:25 btcNode docker[7290]: return _default_decoder.decode(s) Jun 06 18:20:25 btcNode docker[7290]: File "/usr/local/lib/python3.6/json/decoder.py", line 342, in decode Jun 06 18:20:25 btcNode docker[7290]: raise JSONDecodeError("Extra data", s, end) Jun 06 18:20:25 btcNode docker[7290]: json.decoder.JSONDecodeError: Extra data: line 1 column 106 (char 105) Jun 06 18:20:26 btcNode systemd[1]: optimal-buy-gdax-buy.service: Main process exited, code=exited, status=1/FAILURE Jun 06 18:20:26 btcNode systemd[1]: optimal-buy-gdax-buy.service: Unit entered failed state. Jun 06 18:20:26 btcNode systemd[1]: optimal-buy-gdax-buy.service: Failed with result 'exit-code'. `

brndnmtthws commented 6 years ago

You're missing an opening {. Use a JSON validator to verify your config. Here's one: https://jsonlint.com/

coulterj commented 6 years ago

Thanks for the help, I think I have it working now and will see after my next deposit. This is what worked for me.

--coins='{"BTC":{"name":"Bitcoin","withdrawal_address":"BitcoinAddress","external_balance":0}, "ETH":{"name":"Ethereum","withdrawal_address":"EtherAddress","external_balance":0}}'