Ekliptor / WolfBot

Crypto currency trading bot written in TypeScript for NodeJS
https://wolfbot.org
GNU Affero General Public License v3.0
707 stars 214 forks source link

Unable to compile #7

Closed Masterman1980 closed 6 years ago

Masterman1980 commented 6 years ago

Tried to install the bot on a fresh Ubuntu 18. Installed all requirements. However when compiling with TSC it fails keeps outputing a lot of javascript code and never completes. Is the install instruction in the readme still accurate? Also the gulp install finished without errors. I tried npm install as well on a clean clone but that failed because it was unable to find the depency from genetic module.

Ekliptor commented 6 years ago

The ReadMe is up 2 date. I just added a section with more infos about build errors.

Please read them. Plus for any help about installation I need yarn and/or typescript error logs

Masterman1980 commented 6 years ago

The compilation was successfull.

Now only the interface gives:

Unauthorized You are not authorized to use this application. Please contact the administrator for API-Key.

This is in the config:

$ head build / configLocal.js "use strict"; // exported keys in here must be the same as they are written on nconf object (except "root") Object.defineProperty (exports, "__esModule", {value: true}); const root = { "apiKeys": {// empty empty to disable API keys (public access) }, "updateUrl": "", // put your MongoDB connection URL in here: mongodb: // user: password @ host: port / database "mongoUrl": "mongodb: // localhost / wolfbot",


There is an api key from an exchange later in the file but I think the error is about the api key at the top? I left this empty.

Ekliptor commented 6 years ago

The bot tries to generate at least 1 API key on first start. It will always print the first enabled API key in the nodejs log on startup. Sth like this: https://localhost:4492/index.html?apiKey=RANDOM_KEY So you can just click on this link from your log to open the bot with the API.

Masterman1980 commented 6 years ago

Thanks!

The url given at startup with the apikey seems to work. Now the next issue is that if you click on a menu item from the Web interface, eg Strategies or Configuration, a spinner / loader image remains visible and I get the following javascript error:

chrome://devtools/content/webconsole/webconsole.htmlArguments ​0: "App in unknown state with path:" ​1: "index.html" ​chrome://devtools/content/webconsole/webconsole.htmlcallee: Getter & Setter ​length: 2 ​chrome://devtools/content/webconsole/webconsole.htmlSymbol(Symbol.iterator): function values() ​chrome://devtools/content/webconsole/webconsole.html: Object { … }

In the server log, the following from the beginning:


john@wolfbot:~/WolfBot/build$ node app.js --debug --config=Noop --trader=RealjohneTrader --noUpdate --noBrowser 2018-09-14 19:28:42 - info: Server is listening on http://wolfbot:8331/index.html?apiKey=JFSDFHl340udfnsf23SF234 2018-09-14 19:28:42 - info: Server is listening on https://wolfbot:8332/index.html?apiKey=JFSDFHl340udfnsf23SF234 2018-09-14 19:28:42 - verbose: Ta-Lib successfully loaded. Ta-Lib Version 1.0.2 ready 2018-09-14 19:28:42 - info: minified all resources 2018-09-14 19:28:43 - info: Connected to MongoDB 2018-09-14 19:28:43 - verbose: trades collection access error. Probably first start {"message":"Collection trades does not exist. Currently in strict mode.","name":"MongoError","stack":"MongoError: Collection trades does not exist. Currently in strict mode.\n at Function.MongoError.create (/home/john/WolfBot/node_modules/mongodb-core/lib/error.js:31:11)\n at toError (/home/john/WolfBot/node_modules/mongodb/lib/utils.js:139:22)\n at /home/john/WolfBot/node_modules/mongodb/lib/db.js:485:65\n at handleCallback (/home/john/WolfBot/node_modules/mongodb/lib/utils.js:120:56)\n at /home/john/WolfBot/node_modules/mongodb/lib/cursor.js:861:16\n at handleCallback (/home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:171:5)\n at setCursorNotified (/home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:515:3)\n at /home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:599:16\n at queryCallback (/home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:232:18)\n at /home/john/WolfBot/node_modules/mongodb-core/lib/connection/pool.js:469:18\n at process._tickCallback (internal/process/next_tick.js:61:11)","driver":true} 2018-09-14 19:28:43 - info: Initializing database: Creating collections on first start 2018-09-14 19:28:43 - verbose: No test data for init found. Using default values 2018-09-14 19:28:53 - debug: Request: /index.html?apiKey=JFSDFHl340udfnsf23SF234 2018-09-14 19:28:53 - debug: Secure request: /index.html?apiKey=JFSDFHl340udfnsf23SF234 2018-09-14 19:28:53 - debug: Secure request: /css/style.css 2018-09-14 19:28:54 - debug: Secure request: /js/polyfills.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/eventemitter2.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/Chart.bundle.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/ace/ace.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/i18next.min.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/dataTables.bootstrap.js 2018-09-14 19:28:54 - debug: Secure request: /js/constants.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/helper.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/bootstrap-multiselect.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/i18nextXHRBackend.min.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/browserutils.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/tv/charting_library.min.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/functions.js 2018-09-14 19:28:54 - debug: Secure request: /js/bundle.js 2018-09-14 19:28:54 - debug: Secure request: /js/libs/jquery.dataTables.js 2018-09-14 19:28:54 - debug: Secure request: /css/bootstrap-multiselect.css 2018-09-14 19:28:54 - debug: Secure request: /css/libs/bootstrap-datejohnepicker.min.css 2018-09-14 19:28:55 - debug: Secure request: /icons/fav/favicon.ico 2018-09-14 19:28:55 - debug: Secure request: /locales/en.json?v=0.1.0 2018-09-14 19:28:55 - debug: Secure request: /icons/fav/icon_114.png 2018-09-14 19:28:55 - warn: Received WebSocket data without corresponding receiver. Opcode 11 2018-09-14 19:28:55 - warn: Received WebSocket data without corresponding receiver. Opcode 23 2018-09-14 19:28:55 - warn: Received WebSocket data without corresponding receiver. Opcode 18 2018-09-14 19:28:55 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-14 19:28:55 - warn: Received WebSocket data without corresponding receiver. Opcode 22 2018-09-14 19:28:55 - debug: Secure request: /images/github-ico.png 2018-09-14 19:28:55 - debug: Secure request: /icons/fav/icon_57.png 2018-09-14 19:28:55 - debug: Secure request: /images/discord-ico.png 2018-09-14 19:28:55 - debug: Secure request: /images/bg1.jpg 2018-09-14 19:28:55 - debug: Secure request: /fonts/fontawesome-webfont.woff2?v=4.7.0 2018-09-14 19:28:59 - warn: Received WebSocket data without corresponding receiver. Opcode 22 2018-09-14 19:28:59 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-14 19:29:06 - debug: Secure request: /css/style.css 2018-09-14 19:29:06 - debug: Secure request: /css/style.css.map 2018-09-14 19:30:02 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-14 19:30:02 - warn: Received WebSocket data without corresponding receiver. Opcode 12 2018-09-14 19:30:05 - warn: Received WebSocket data without corresponding receiver. Opcode 12 2018-09-14 19:30:05 - warn: Received WebSocket data without corresponding receiver. Opcode 13****


In other words, when loading certain pages, errors occur as in bold type above.

The main menu works, incidentally, but Strategies and Configuration not. Backtesting does work.

Ekliptor commented 6 years ago

these were 2 bugs when using the bot without API keys (public access for everyone). I just commited a fix for both of them. Please pull the latest version. The URL should now show correctly without API key and you will be able to navigate.

Masterman1980 commented 6 years ago

I have compiled and started the new version. The server listening url that is displayed after starting no longer contains a generated api key. With that url application is accessible so that seems easier to work now. However, when you click on the menu items, the situation is the same. In the browser a load spinner that continues to load. In the log the same warnings as previously reported.

Ekliptor commented 6 years ago

I have no idea what's causing that bug on your side. Please verify that you are using the latest bundle.js from the public js folder: https://github.com/Ekliptor/WolfBot/tree/master/public/js (that's another TypeScript project root you can compile with webpack, but no need to. just make sure you use the provided UI code)

Then please tell me what happens when you directly try to access certain pages, such as: https://wolfbot:8331/strategies or /config The bot uses the History push state API of browsers for navigation. Since you are using Chrome, that must work in your browser.

Masterman1980 commented 6 years ago

wolfbot: ~/WolfBot/build$ ls public/js/ classes wolfbot: ~/WolfBot/build$ ls ../public/js/ bundle.js bundle.js.map classes constants.js controllers hooks.js index.ts internal.d.ts libs polyfills.js routes.ts tsconfig.json types utils


build commands

rm -rf WolfBot git clone https://github.com/Ekliptor/WolfBot cd WolfBot yarn install find node_modules/@ekliptor -type f -name 'tsconfig.json' (cd node_modules/@ekliptor/bit-models && tsc) (cd node_modules/@ekliptor/browserutils && tsc) (cd node_modules/@ekliptor/apputils && tsc) cp ../configLocal.ts ./ tsc cd build/ node app.js --debug --config=Noop --trader=RealTimeTrader --noUpdate –noBrowser

versions

$ node -v v10.10.0

$ mongo --version MongoDB shell version v3.6.3 git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5 OpenSSL version: OpenSSL 1.1.0g 2 Nov 2017 allocator: tcmalloc modules: none build environment: distarch: x86_64 target_arch: x86_64

$ tsc -v Version 2.8.4

$ yarn -v 1.9.4

$ webpack --version 4.19.0

$ cat /etc/debian_version buster/sid

$ uname -a Linux wolfbot 4.15.0-34-generic #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

browser console output

wolfbot

Ekliptor commented 6 years ago

Thx for your detailed report.

My last commit to enable access without API key had indeed a bug. I could reproduce your problem. Now it's fixed and should work. Please try again.

You can ignore the missing source map reports. If you start the bot with the --debug flag source maps will be served...

Masterman1980 commented 6 years ago

Thanks for the new version. I have compiled and the error in the console output is gone:

bot1

But the spinner keeps loading in the browser when you go to Strategies of Configuration and in the server log also the same:

wolfbot:~/WolfBot/build$ node app.js --debug --config=Noop --trader=RealTimeTrader --noUpdate --noBrowser 2018-09-19 07:54:30 - info: Server is listening on http://wolfbot:8331/index.html 2018-09-19 07:54:30 - info: Server is listening on https://wolfbot:8332/index.html 2018-09-19 07:54:30 - verbose: Ta-Lib successfully loaded. Ta-Lib Version 1.0.2 ready 2018-09-19 07:54:30 - info: Connected to MongoDB 2018-09-19 07:54:30 - info: minified all resources 2018-09-19 07:54:30 - verbose: trades collection access error. Probably first start {"message":"Collection trades does not exist. Currently in strict mode.","name":"MongoError","stack":"MongoError: Collection trades does not exist. Currently in strict mode.\n at Function.MongoError.create (/home/john/WolfBot/node_modules/mongodb-core/lib/error.js:31:11)\n at toError (/home/john/WolfBot/node_modules/mongodb/lib/utils.js:139:22)\n at /home/john/WolfBot/node_modules/mongodb/lib/db.js:485:65\n at handleCallback (/home/john/WolfBot/node_modules/mongodb/lib/utils.js:120:56)\n at /home/john/WolfBot/node_modules/mongodb/lib/cursor.js:861:16\n at handleCallback (/home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:171:5)\n at setCursorNotified (/home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:515:3)\n at /home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:599:16\n at queryCallback (/home/john/WolfBot/node_modules/mongodb-core/lib/cursor.js:232:18)\n at /home/john/WolfBot/node_modules/mongodb-core/lib/connection/pool.js:469:18\n at process._tickCallback (internal/process/next_tick.js:61:11)","driver":true} 2018-09-19 07:54:30 - info: Initializing database: Creating collections on first start 2018-09-19 07:54:30 - verbose: No test data for init found. Using default values 2018-09-19 07:56:12 - debug: Secure request: /strategies 2018-09-19 07:56:12 - debug: Secure request: /css/style.css 2018-09-19 07:56:12 - debug: Secure request: /js/libs/i18next.min.js 2018-09-19 07:56:12 - debug: Secure request: /js/polyfills.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/i18nextXHRBackend.min.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/Chart.bundle.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/bootstrap-multiselect.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/eventemitter2.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/ace/ace.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/jquery.dataTables.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/dataTables.bootstrap.js 2018-09-19 07:56:12 - debug: Secure request: /js/constants.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/functions.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/helper.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/browserutils.js 2018-09-19 07:56:12 - debug: Secure request: /js/libs/tv/charting_library.min.js 2018-09-19 07:56:12 - debug: Secure request: /js/bundle.js 2018-09-19 07:56:13 - debug: Secure request: /css/bootstrap-multiselect.css 2018-09-19 07:56:13 - debug: Secure request: /css/libs/bootstrap-datetimepicker.min.css 2018-09-19 07:56:13 - debug: Secure request: /icons/fav/icon_114.png 2018-09-19 07:56:13 - debug: Secure request: /favicon.ico 2018-09-19 07:56:13 - debug: Secure request: /locales/en.json?v=0.1.0 2018-09-19 07:56:13 - debug: Secure request: /css/style.css.map 2018-09-19 07:56:14 - warn: Received WebSocket data without corresponding receiver. Opcode 11 2018-09-19 07:56:14 - warn: Received WebSocket data without corresponding receiver. Opcode 23 2018-09-19 07:56:14 - warn: Received WebSocket data without corresponding receiver. Opcode 18 2018-09-19 07:56:14 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-19 07:56:14 - warn: Received WebSocket data without corresponding receiver. Opcode 12 2018-09-19 07:56:14 - debug: Secure request: /fonts/fontawesome-webfont.woff2?v=4.7.0 2018-09-19 07:56:17 - warn: Received WebSocket data without corresponding receiver. Opcode 12 2018-09-19 07:56:17 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-19 07:56:18 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-19 07:56:18 - warn: Received WebSocket data without corresponding receiver. Opcode 20 2018-09-19 07:56:20 - warn: Received WebSocket data without corresponding receiver. Opcode 20 2018-09-19 07:56:20 - warn: Received WebSocket data without corresponding receiver. Opcode 12 2018-09-19 07:59:10 - verbose: WebSocket connection closed with code 1001: 2018-09-19 07:59:20 - debug: Request: / 2018-09-19 07:59:20 - debug: Secure request: / 2018-09-19 07:59:20 - debug: Secure request: /css/style.css 2018-09-19 07:59:20 - debug: Secure request: /js/polyfills.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/i18next.min.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/eventemitter2.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/Chart.bundle.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/bootstrap-multiselect.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/i18nextXHRBackend.min.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/ace/ace.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/dataTables.bootstrap.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/jquery.dataTables.js 2018-09-19 07:59:20 - debug: Secure request: /js/constants.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/functions.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/browserutils.js 2018-09-19 07:59:20 - debug: Secure request: /js/bundle.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/tv/charting_library.min.js 2018-09-19 07:59:20 - debug: Secure request: /js/libs/helper.js 2018-09-19 07:59:20 - debug: Secure request: /css/bootstrap-multiselect.css 2018-09-19 07:59:20 - debug: Secure request: /css/libs/bootstrap-datetimepicker.min.css 2018-09-19 07:59:20 - debug: Secure request: /locales/en.json?v=0.1.0 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 11 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 23 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 18 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 22 2018-09-19 07:59:21 - debug: Secure request: /images/github-ico.png 2018-09-19 07:59:21 - debug: Secure request: /icons/fav/icon_57.png 2018-09-19 07:59:21 - debug: Secure request: /images/bg1.jpg 2018-09-19 07:59:21 - debug: Secure request: /images/discord-ico.png 2018-09-19 07:59:21 - debug: Secure request: /fonts/fontawesome-webfont.woff2?v=4.7.0 2018-09-19 07:59:22 - warn: Received WebSocket data without corresponding receiver. Opcode 22 2018-09-19 07:59:22 - warn: Received WebSocket data without corresponding receiver. Opcode 12 2018-09-19 07:59:26 - debug: Secure request: /css/style.css 2018-09-19 07:59:27 - debug: Secure request: /css/style.css.map 2018-09-19 07:59:33 - warn: Received WebSocket data without corresponding receiver. Opcode 12 2018-09-19 07:59:33 - warn: Received WebSocket data without corresponding receiver. Opcode 13

Ekliptor commented 6 years ago

2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 11 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 23 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 18 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 13 2018-09-19 07:59:21 - warn: Received WebSocket data without corresponding receiver. Opcode 22

I just ran it with exactly the same startup params and it's working for me. These errors suggest that the subscribe() calls in the WebSocketController constructor aren't called. The only way I see how this could happen is some major exchange error. Does this happen on the 2nd start too? (when there is no more "Initializing database" log message) Do you have at least 1 exchange api key set? There should be a logline like this:

info: Loading exchange Bitfinex with apiKey index 0

EDIT. found a bug: this definitely happens on 1st start after installation always. 2nd start should work. Fix already comitted (to bit-models package)

Ekliptor commented 6 years ago

closing the issue after 4 days without response. I assume it's solved, otherwise please come again;)