stellar-deprecated / kelp

Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
https://kelpbot.io
Other
1.09k stars 263 forks source link

[Epic] Kelp-as-a-Service #509

Open nikhilsaraf opened 4 years ago

nikhilsaraf commented 4 years ago

This is the master-list of issues required to make Kelp-as-a-Service a reality, written in order of precedence.

For specific tasks, we should create new issues and link there here next to the specified item.

Essential Tasks

Not essential for v1.0

May be required later (but noting here anyway)

brujoand commented 3 years ago

Sorry for adding this here, but I'm testing a few approaches of getting this to work with the current code base, and my problems seem to touch on a bit off everything in this list so I thought this would be the best place for it.

I created a simple docker container based on alpine that only installs bash and fetches the latest kelp binary and uploads the image to docker hub. I had to create a dummy xdg-open script to trick kelp into not launching the browser, but even then the UI webpage doesn't work properly because it fails to fetch certain resources. The last output from kelp is '2021/03/07 08:12:12 Serving frontend and API server on HTTP port: 8000', the webpage appears to be working until I try adding a new bot where I just end up at /new and an empty page. During all the interaction the browser console shows 'Uncaught (in promise) TypeError: NetworkError when attempting to fetch resource.' every second. The url it's trying to hit is 'http://localhost:8000/api/v1/fetchKelpErrors' but it seems the entire API endpoint is unresponsive.

Regarding #347 and naming of the deamon mode, I'd suggest having two options instead of one, namely 'server' and 'gui'. Where the current 'server' flag would be renamed to 'gui' and actually launches a gui either through electron or by opening a browser window. Then the 'server' option would simply run kelp as a deamon process. The reason why I think these are completely unrelated run modes is that the deamon mode would probably only be used on remote installs, whereas 'gui' would be for local use. And eventually that might be the default way for users to use the app locally.

In any case, my plan is to deploy this on k8s using helm so whenever that becomes relevant I could help on that. But right now I'm just trying to see if there is a way to make this work and also to ping on this process as it seems to have been quiet for a while.

nikhilsaraf commented 3 years ago

Hi @brujoand thanks for commenting on this issue, it's the right place.

  1. You can now run kelp without bringing up the browser or electron by adding the following cli flag --enable-kaas For example: ./bin/kelp server --enable-kaas

  2. Can you provide more information about the network error you are getting in relation to the /fetchKelpErrors endpoint. Log files and/or screenshots will help. the more info you can provide the better.

  3. splitting up the commands into server and gui makes sense. I can include it in this list of items above, although not a priority right now. see --enable-kaascli option for now.

  4. The backend is now multi-tenant so supports multiple users from a data structures and API perspective, however a fair amount of work needs to be done to fully introduce the concept of users into the system. That is being worked on but unfortunately not on a full-time basis. Will have more updates soon. I will try to keep this list of items in my original description up to date.