ctubio / Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++
https://127.0.0.1:3000
Other
3.37k stars 823 forks source link

3 headed monkey found - windows 10 x64 #877

Closed juaxix closed 5 years ago

juaxix commented 5 years ago

Hello, and thanks for your help, I was be able to run the program in a debian with no problem with coinbase credentials,also with windows 10 -demo/NULL mode- but when i set the credentials it fails to keep running.

So, the bot is telling me to post it as an issue now: This is my .bat:

@echo off
setlocal enableDelayedExpansion
rem OPTIONAL_ARGUMENTS="--colors --autobot"
set OPTIONAL_ARGUMENTS=--colors --naked --debug-wallet
rem ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
rem ▌____ .
rem ▌ II ▐_______________________________________________.
rem ▌¯¯¯¯ .
rem █ UI_USERNAME .
rem ██ - Allows any username, to authenticate UI connections.
set UI_USERNAME=jbelon
rem UI_USERNAME=NULL
rem  ▌____________________________________________________.
rem  █ UI_PASSWORD .
rem  ██ - Allows any password, to authenticate UI connections.
set UI_PASSWORD=pass
rem UI_PASSWORD=NULL
rem  ▌____________________________________________________.
rem  █ UI_OPENPORT .
rem  ██ - Allows any port number, to listen to UI connections.
rem UI_OPENPORT=6969
set UI_OPENPORT=3000
rem  ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
rem  ▌_____ .
rem  ▌ III ▐______________________________________________.
rem  ▌¯¯¯¯¯ .
rem  █ API_EXCHANGE .
rem  ██ - Allows one of the following exchange names (or leave NULL for test mode):
rem API_EXCHANGE=COINBASE
rem API_EXCHANGE=BITFINEX
rem API_EXCHANGE=BITFINEX_MARGIN
rem API_EXCHANGE=ETHFINEX
rem API_EXCHANGE=ETHFINEX_MARGIN
rem API_EXCHANGE=HITBTC
rem API_EXCHANGE=FCOIN
rem API_EXCHANGE=KRAKEN
rem API_EXCHANGE=KORBIT
rem API_EXCHANGE=POLONIEX
set API_EXCHANGE=COINBASE
rem ▌____________________________________________________.
rem █ API_CURRENCY .
rem ██ - Allows any existent currency pair (see the website of the
rem xchange), the format must be "AAA/ZZZ".
set API_CURRENCY=BTC/EUR
rem API_CURRENCY=BTC/USD
rem  ▌____________________________________________________.
rem  █ API_KEY .
rem  ██ - Allows any valid API KEY (see the website of the exchange).
rem  ██ - All exchanges must have API KEY.
set API_KEY=exampleapikey

rem  ▌____________________________________________________.
rem  █ API_SECRET .
rem  ██ - Allows any valid API SECRET (see the website of the exchange).
rem  ██ - All exchanges must have API SECRET.
set API_SECRET=exampleapisecret

rem  ▌____________________________________________________.
rem  █ API_PASSPHRASE .
rem  ██ - Allows any valid API PASSPHRASE (see the website of the exchange).
rem  ██ - Only COINBASE and KORBIT exchanges must have API PASSPHRASE,other exchanges can be NULL.
set API_PASSPHRASE=exampleapipassphrase

rem  ▌____________________________________________________.
rem  █ API_USERNAME .
rem  ██ - Allows any valid API USERNAME (see the website of the exchange).
rem  ██ - Only KORBIT exchange must have API USERNAME, other exchanges can be NULL.
rem API_USERNAME=exampleapiusername
set API_USERNAME=NULL
rem  ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
rem  ▌____ .
rem  ▌ IV ▐______________________________________________ .
rem  ▌¯¯¯¯ .
rem  █ K_BINARY_FILE .
rem  ██ - Allows one executable file from PATH.
rem K_BINARY_FILE=K-hello-world
set K_BINARY_FILE=K-trading-bot.exe
rem  ██ - That's all. You can create multiple *.sh files ready to be executed anytime.
rem  █ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯.
rem  ▌ .
rem  until `'valgrind` `'gdb --args` $K_BINARY_FILE \
rem --title ${0''*/} \
rem --port $UI_OPENPORT \
rem --user $UI_USERNAME \
rem --pass $UI_PASSWORD \
rem --exchange $API_EXCHANGE \
rem --currency $API_CURRENCY \
rem --apikey $API_KEY \
rem --secret $API_SECRET \
rem --passphrase $API_PASSPHRASE \
rem --username $API_USERNAME \
rem $OPTIONAL_ARGUMENTS "$@" ; '
rem do ' K '
rem echo K crashed with exit code $?.. Respawning.. ; 
rem sleep 3 ; 
rem done ; 
rem  ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
%K_BINARY_FILE% --title "K" --port=%UI_OPENPORT% --user=%UI_USERNAME% --pass=%UI_PASSWORD% --exchange=%API_EXCHANGE% --currency=%API_CURRENCY% --apikey=%API_KEY% --secret=%API_SECRET% --passphrase=%API_PASSPHRASE% --username=%API_USERNAME% %OPTIONAL_ARGUMENTS% 

and drives to this error:

K-trading-bot win64-x86_64 2019-02-04 20:17:50.
v0.4.12+14 (0day).
.678694 CF Outbound IP address is localhost.
.736802 GW COINBASE allows client IP.
.736802 GW COINBASE handshake:
- gateway: https://api.pro.coinbase.com
- gateway: wss://ws-feed.pro.coinbase.com
- gateway: fix.pro.coinbase.com:4198
- autoBot: no
- symbols: BTC-EUR
- minTick: 0.0000000000
- minSize: 0.0000000000
- makeFee: 0.0000000000
- takeFee: 0.0000000000.
.736802 DB loaded OK from ./koinbase*.db.
.736802 DB Warrrrning: using default values for Quoting Parameters.
.736802 DB Warrrrning: consider to warm up some EWMA Values.
.736802 UI Warrrrning: Connected web clients will enjoy unsecure SSL encryption..
(because the private key is visible in the source!). See --help argument to setup your own SSL.
.737796 UI ready at https://localhost:3000.
.721500 GW COINBASE Unable to read book levels.
terminate called after throwing an instance of 'FIX::RuntimeError'
  what():  Runtime error: Unable to configure verify locations for client authentication
.863093 Errrror: 22 (Three-Headed Monkey found):
- exchange: COINBASE
- currency: BTC .. EUR
- lastbeat: 1.448000
- binbuild: K-trading-bot win64-x86_64

Yikes!
please copy and paste the error above into a new github issue (noworry for duplicates).
If you agree, go to https://github.com/ctubio/Krypto-trading-bot/issues/new

.863093 GW COINBASE Attempting to cancel all open orders, please wait..
.122179 GW COINBASE cancel all open orders OK.
K exit code 1.

I'm running it from windows console and cygwin console and tried also not setting the database file, all leads to the same error.

ctubio commented 5 years ago

seems libquickfix is missing a openssl certificate, and fails to initiatio the encrypted connection to exchange.

on unix we download the certs using the Makefile (https://github.com/ctubio/Krypto-trading-bot/blob/master/Makefile#L187) on install

maybe this is what is missing in your setup?

juaxix commented 5 years ago

Uhm, I have those, just to verify

I do this (cygwin)

curl -s --time-cond /etc/ssl/certs/ca-certificates.crt https://curl.haxx.se/ca/cacert.pem -o /etc/ssl/certs/ca-certificates.crt

looks like it is ok:

$ ls /etc/ssl/certs/ca-certificates.crt -luxalh -rwxr-x--- 1 Juax Ninguno 215K feb. 10 12:27 /etc/ssl/certs/ca-certificates.crt

same output

K-trading-bot win64-x86_64 2019-02-04 20:17:50.
v0.4.12+14 (0day).
.371227 CF Outbound IP address is localhost.
.610340 GW COINBASE allows client IP.
.610340 GW COINBASE handshake:
- gateway: https://api.pro.coinbase.com
- gateway: wss://ws-feed.pro.coinbase.com
- gateway: fix.pro.coinbase.com:4198
- autoBot: no
- symbols: BTC-EUR
- minTick: 0.0000000000
- minSize: 0.0000000000
- makeFee: 0.0000000000
- takeFee: 0.0000000000.
.610340 DB loaded OK from ./koinbase*.db.
.610340 DB Warrrrning: using default values for Quoting Parameters.
.611341 DB Warrrrning: consider to warm up some EWMA Values.
.611341 UI Warrrrning: Connected web clients will enjoy unsecure SSL encryption..
(because the private key is visible in the source!). See --help argument to setup your own SSL.
.611341 UI ready at https://localhost:3000.
.009735 GW COINBASE Unable to read book levels.
terminate called after throwing an instance of 'FIX::RuntimeError'
  what():  Runtime error: Unable to configure verify locations for client authentication
.166159 Errrror: 22 (Three-Headed Monkey found):
- exchange: COINBASE
- currency: BTC .. EUR
- lastbeat: 2.060000
- binbuild: K-trading-bot win64-x86_64

Yikes!
please copy and paste the error above into a new github issue (noworry for duplicates).
If you agree, go to https://github.com/ctubio/Krypto-trading-bot/issues/new

.166159 GW COINBASE Attempting to cancel all open orders, please wait..
.405862 GW COINBASE cancel all open orders OK.
K exit code 1.
ctubio commented 5 years ago

morning''' oh well it may be really broken :S i will need to review it; but note that winy is not the main supported platform so may take some days for me to review it :S

many thanks for the report'''

ctubio commented 5 years ago

we dont use anymore libquickfix, so this issue must be fixed; sorry for the delay