Making the most out of your Gunbot

Hi guys,

I started investigating Gunbot when their collaboration with Nash started. It’s a powerful tool which will turn you into an algo trader if you’re willing to dedicate some time to learn how it works.

At any step of the way, you can ask for help to your reseller and installation is fairly straightforward. The next step - and the one I would like to tackle in this post - is making your Gunbot autonomous so that you can turn off your computer while letting it run.

Rent a VPS and connect to it

You first need to rent a VPS. A VPS is a (Virtual Private) Server. For our needs, this should not cost more than $10 per month. As for recommendations, @canesin introduced us recently to Vishnu Korde, CEO of StackOS who could provide such a service (payable with NashLink and authentication using “Login with Nash” soon? :star_struck:). I do recommend a Unix-based distribution (and will assume you made this choice too in the remainder of this tutorial). Most common one is ubuntu (you can use latest version 20.04).

When this is done, you should receive credentials to connect to your server using SSH:

  • IP address of your server
  • password

To connect to your server using SSH on Mac or Linux, open a terminal and run the following command:

ssh root@<ip-address-of-your-server> ( ctrl + D to disconnect)

(On Windows, you may use the console or better yet a simple program like PuTTY)

Prepare your server

Once you’re connected, you will see something like this:

root@vmi655372:~#

It means you are connected as the user root, which is more or less the admin of your VPS. It is generally good practice to create and use a user with limited privileges, but for simplicity you can use root: it’s not really an issue.

Create a gunbot folder to isolate your work:

mkdir gunbot

Then get into that new folder

cd gunbot

You can check which files/folder are in there by running:

ls

(obviously the command will return nothing, since we just created the folder)

Install Gunbot

N.B: Once Gunbot releases an official stable release which supports Nash, it will simplify the process, but for now this is it.

You will now need to get the Gunbot files on your server. This is a 4-step process (to do on your computer, not on the server):

1/ Download the latest stable build (18.8.8 as I write this) from Github: it is the file called lin.zip. Once downloaded, you will need to uncompress it (this should be a native option when you double click it).
2/ Get the @neon-exchange folder from build 20.0.4 (ask your reseller for this) and place the folder in the node_modules from the folder you extracted above
3/ Get the latest executable - currently 20.2.8 (ask your reseller). It should be called gunthy-linux. Replace the one you see at the root of your gunbot by this new one.
4/ Open a new terminal on your computer and navigate* until you are inside the folder downloaded on step 1 and run the following command:

scp -r * root@<ip-address-of-your-server>:/root/gunbot/

(you will need to input your server password. This should be fairly long depending on your connection speed, as you are sending every file onto your server)

Now back to your ssh terminal, check the files have arrived using ls. It should show all the Gunbot files.

Make sure your gunthy-linux file is executable by running:

chmod +x gunthy-linux

That’s it, you are now ready. Launch Gunbot by running:

./gunthy-linux

Check that logs are normal. Additionally, on your favorite browser on your computer, go to http:// to use Gunbot’s GUI.

Keep the Gunbot process running

At this point, if you close everything, your Gunbot will cease to run. We need to make sure it continues to run, even after you’ve closed the SSH connection.

To achieve this, you will need a program called pm2. Download it (on your server) by running on your server:

apt-get install pm2

Stop the Gunbot process if it was still running. Then, from your Gunbot server, run:

pm2 start gunthy-linux

To check the logs:

pm2 logs (ctrl + C to exit)

To check running pm2 processes:

pm2 ls

To stop the gunbot/pm2 process:

pm2 stop gunthy-linux

That’s it! Congratulations if you made it until this point. You now have an autonomous Gunbot running on your VPS. You can safely turn off your computer :sunglasses:


Bonus: Navigating in a unix terminal

Check in what folder you are (pwd stands for “print working directory”):

pwd

Go to a folder (cd is for “change directory”):

cd <folder-name>

Go uproot:

cd ..

26 Likes

Great work man!

1 Like

I think a better option is simply to buy a Raspberry Pie (around 50$), but only if your connection is stable enough.

Apparently the latest build (and only one compatible with Nash) is not stable enough for RPI4.

But when it is, it will be an alternative solution yes :slight_smile:

1 Like

Absolutely fantastic Mark. A detailed and complete step by step guide on how to set up your Gunbot on a VPS. But, if the truth be told I gave up on the idea as soon as we got to ssh root@<ip-address-of-your-server> ( ctrl + D to disconnect). At that point I threw the idea straight into the too hard/to much time bin.

If BOT’s are the answer for Nash then they need to make them as easy as possible for the average user to set up. I think its fantastic we have people like you Mark that go out of their way to make guides for us but anyone that has limited Linux or PC knowledge would give up on this idea right away.

I see in the comments some ideas around Raspberry Pie. Could Nash or a community member make and sell them with simple instruction on how to put in your user details/API?. I know there would be risk with this if a community member was doing it but if it was a Nash product then I could see it working.

If Nash and Gunbot could make running it on Pi stable I would buy one for sure.

I envision a a little Pi box with a Nash robot logo ‘Community designed of course’ just beavering away next to my desk.

Anyway food for thought. And again thank you Mark for taking the time to make this guide. You do fantastic work in the community for Nash.

For cheap Nash community rates on the VPS message @VishnuKorde on Telegram.
For premium Nash community support setting up Gunbot message @sdh1981 on Telegram.

4 Likes

Hey guys,

I had a chance to speak with Vishnu and got the opportunity to watch a demo of his product: I gotta say I’m impressed with the whole idea and it goes way beyond providing simple hosting solutions. The aim is to provide a seamless experience to deploy nodes, apps, programs, etc. with nearly no technical knowledge and to create a true community-driven economy around it.

I’ll let Vishnu present his solution further when he chooses, but what this means for any Nash community member who is using Gunbot is that you can launch your own instance on the cloud in literally a few clicks. You can join this Telegram group and ask to be added to the private beta if you want to learn more.

5 Likes