Username: Password:

Author Topic: GUNBOT - Linux Tutorial  (Read 36730 times)

Offline jroddingham

  • Rookie
  • *
  • Posts: 16
    • View Profile
GUNBOT - Linux Tutorial
« on: April 12, 2017, 02:00:37 PM »
I will assume you've got a working linux machine. VPS, local, whatever. There's already a ton of info on Google about getting that functional. (Gunthar if required we can maybe throw some links in here too, VPS suggestions etc)

OK. First thing you need to do is figure out which distribution you are using. Different versions have different package managers. It won't affect being able to run the gunbot executable. I will give instructions for Debian based distros, and we can append to it with package commands for the others if need be.
You now should be sitting in the home directory of your session.


Now you need to go grab the zip file containing the latest gunbot goodies. You do this by issuing a 'wget' command, which will copy that file to your home directory.
Open your browser and go to https://github.com/GuntharDeNiro/BTCT/releases
Find the latest one, right click the url and copy it to your clipboard. Go back to your terminal and issue a:

Code: [Select]
jrod@ISHTAR:~$ wget https://github.com/GuntharDeNiro/BTCT/releases/download/Beta2.0.4lin/gunbotv2.0.4_linux_x86_x64.zip

This will download the zip file to your home directory. (Gunthar doesn't use tar apparently  ;)) You now need to unzip it. You likely don't have unzip installed, so using the default Debian package manager you would issue this command:

Code: [Select]
jrod@ISHTAR:~$ sudo apt-get install unzip

You will be prompted for your password. Sudo is issued in this type of linux where you are a non-root user. You are telling the shell to run the command with elevated privileges. This is basically a security feature. After installing that package, you can now unzip your files.

Code: [Select]
jrod@ISHTAR:~$ unzip gunbotv2.0.4_linux_x86_x64.zip

OK, so you've gotten this far. the command 'ls' in linux will list the contents of the directory you're in. Let's do that now.

Code: [Select]
jrod@ISHTAR:~$ ls

You will see the original file you downloaded, and now a directory that contains everything that was unzipped. Now you need to get into that directory to do a couple more things. The command in linux to change a directory is 'cd' (It's also this in DOS and Windows terminal) You can go back a directory with a 'cd ..' and recall the list directory with 'ls'

Code: [Select]
jrod@ISHTAR:~$ cd gunbotv2.0.4_linux_x86_x64

Now, the gunbot file needs to be set to be executable, else you'll get an error about not having permissions to run it. So, let's do that!

Code: [Select]
jrod@ISHTAR:~/gunbot/gunbotv2.0.4_linux_x86_x64$ chmod +x gunbot

Now, to run the file from linux terminal it's the name of the file preceded by a './', like this:

Code: [Select]
jrod@ISHTAR:~/gunbot/gunbotv2.0.4_linux_x86_x64$ ./gunbot BTC_DASH
Gunthar has provided that one pair as an example, you will run gunbot executable against each pair you want to run. You will have to use a program called 'screen' or 'tmux' in order to run a session on a remote terminal, and not have it die when you disconnect.  I will give some brief instructions as well as some links on using tmux. Here's what it looks like when running:



So, tmux. Basically think of this as a container for all your multiple terminal sessions. There are many ways to do this, and Crypto Wally has by far the best implementation (which hopefully he posts at some point) but for now, this will get you something reasonably functional. First a simple google of 'tmux tutorials' will bring you lots of stuff. Videos are out there as well as detailed tutorials. I am going to show you how I currently look at my 14 or so pairs.

You're going to need to install tmux.

Code: [Select]
jrod@ISHTAR:~/gunbot/gunbotv2.0.4_linux_x86_x64$ sudo apt-get install tmux
Run tmux after installing:

Code: [Select]
jrod@ISHTAR:~/gunbot/gunbotv2.0.4_linux_x86_x64$ tmux

This will open up a new window, started in the directory you executed from. You will notice the new line at the bottom showing you the current active window. Tmux is the container in which everything else will nest in. Now, for tmux to know you're issuing a command to it, and not anything else you have to issue a (configurable) command to tell tmux to get ready and follow your godlike commands issued from your fingertips. By default, this is 'ctrl - b'. Here's a handy list of things you can do with tmux: https://gist.github.com/MohamedAlaa/2961058

You have your choice of running multiple full size windows that you can toggle between, or splitting the exiting window into smaller ones that you can see fill all at once. This is a matter of preference, but after a bunch of pairs due to the way the console outputs you can't really see much of what is going on at that point. That's why Wally pipes the output to tee and then reformats it. Anyway...

Here's how it looks if you issue a combination of 'ctrl-b %' commands and 'ctrl-b "' commands.

ctrl-b " splits the screen horizontally:


ctrl-b % splits the active window vertically:


You can move around the windows with a ctrl-b (arrow key), and kill any one of them with a ctrl-b x. Again, take a look at the commands list and play around.

Now, here's what I currently do for better visibility. Instead of a split screen, each command is opened in it's own full window and I can tab between those. You can see by default it's named 'bash' at the bottom, but that's because we haven't done anything. If you run a gunbot session, it will want to be named gunbot. You will want to rename these. You can rename your window with a 'ctrl-b ,' command. The bar at the bottom changes asking you for a new name, like this:



you can create a new window and rename it with a 'ctrl-b c' to (c)reate the new window and again a 'ctrl-b ,' command to rename it. There's two ways to toggle between the windows within tmux. You can do a 'ctrl-b' followed by the number of the window you're going for, or a 'ctrl-b w' which will bring you an interactive list to switch around.

OK, NOW DON'T FORGET THIS PART!!!

when you are ready to detach from your session, you will want to issue a 'ctrl-b d' for (d)etaching from your session. This will drop you back to your regular shell prompt, you can safely exit your shell/session. When you want to reattach, just issue a simple 'tmux attach' to get back to it. That works easily enough for the single tmux session, if you want to run multiple sessions that's another story.

Next up, you may want to play with the 1000 trades or best currencies. You will need to have the latest version of node installed.

check the version of nodejs you have by running:

Code: [Select]
jrod@ISHTAR:~$ nodejs --version

You don't want version 4.2.6, you'll likely need to update. Easiest cleaner way will be to purge your old version, and then curl to install the newer package.

Code: [Select]
jrod@ISHTAR:~$ sudo apt-get purge nodejs-legacy



Now, curl to get the newer version and prepare to install.

Code: [Select]
jrod@ISHTAR:~$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

Now, go ahead and intstall nodejs.

Code: [Select]
jrod@ISHTAR:~$ sudo apt-get install nodejs

At this point you can run the 1000 Trades and the Best Currencies apps from within your working folder.



Also, check this thread: https://gunthy.org/index.php?topic=74.0

It has a very nice way to run all your pairs at once without any fancy screen bash scripts. Well worth the look!

Gunthar already fattened my BTC wallet, but if you're feeling generous and this helped you out, here's my cardboard sign and tip jar wallet:

1ASxHgXRmubH5Mg9Wc4sG5HtcNwSL5kWeD
« Last Edit: April 18, 2017, 01:21:09 PM by jroddingham »

Offline AlfonseX

  • Contributor
  • **
  • Posts: 101
  • Trop de chefs, pas assez d'indiens !
    • View Profile
Re: Linux tutorial
« Reply #1 on: April 13, 2017, 12:45:18 AM »
Hello,
thanks for this tutorial. It will help. The wiki is no longer up to date.
The "chmod +x" must be include in the README.md, IMO.

tmux is a must have. I like it.

Didn't know about
Code: [Select]
$ node currenciesbut here, on Fedora, it says :
Code: [Select]
Error: Cannot find module '/home/…/gunbotv2.0.3_linux_x86_x64/currencies'no module currencies :<
If you think I helped you, give me a drink:
in btc: 12aeQSpytxoehCEptQE8tUJVVSAS42LvXo
in eth: 0x02a611f0c15bccdb6fa8e5e4b0692ff6d77852bd

Offline jroddingham

  • Rookie
  • *
  • Posts: 16
    • View Profile
Re: Linux tutorial
« Reply #2 on: April 13, 2017, 02:14:29 AM »
I am glad it helped. Was the currencies in the 2.0.3b version even? Is there a currencies.js in your folder?

Offline AlfonseX

  • Contributor
  • **
  • Posts: 101
  • Trop de chefs, pas assez d'indiens !
    • View Profile
Re: Linux tutorial
« Reply #3 on: April 13, 2017, 02:26:17 AM »
Resolve.
I update to 2.04 and it's ok.
Thank you.
 :)
If you think I helped you, give me a drink:
in btc: 12aeQSpytxoehCEptQE8tUJVVSAS42LvXo
in eth: 0x02a611f0c15bccdb6fa8e5e4b0692ff6d77852bd

Offline strshtr

  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: Linux tutorial
« Reply #4 on: April 13, 2017, 06:09:28 PM »
TMUX cheatsheet

https://gist.github.com/MohamedAlaa/2961058

You can enable mouse support too!
setw -g mode-mouse on

Offline jroddingham

  • Rookie
  • *
  • Posts: 16
    • View Profile
Re: Linux tutorial
« Reply #5 on: April 14, 2017, 12:50:10 PM »
TMUX cheatsheet

https://gist.github.com/MohamedAlaa/2961058

You can enable mouse support too!
setw -g mode-mouse on

I had that link in the tutorial, didn't know about mouse support heh. Interesting.

Offline strshtr

  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: Linux tutorial
« Reply #6 on: April 14, 2017, 05:02:56 PM »
TMUX cheatsheet

https://gist.github.com/MohamedAlaa/2961058

You can enable mouse support too!
setw -g mode-mouse on

I had that link in the tutorial, didn't know about mouse support heh. Interesting.

It's easier for me to resize my panes using the mouse to drag and resize the panes.

Offline ozil_m

  • Rookie
  • *
  • Posts: 1
    • View Profile
Re: GUNBOT - Linux Tutorial
« Reply #7 on: April 22, 2017, 12:18:19 AM »
Hey, thanks for the awesome tutorial. I am unable to run 1000T though. I run the command: 'node 1000trades BTC_XXX' and I make the config file for this pair too as BTC_XXX-config.js. But for some reason the 1000trades.js relies on config.js, especially the CURRENCIES param. I am lost and have tried everything to run this with pm2. Please can you help with this?

Offline earendil

  • Rookie
  • *
  • Posts: 5
    • View Profile
Re: GUNBOT - Linux Tutorial
« Reply #8 on: April 25, 2017, 02:40:29 AM »
Hi ozil_m,
Have you found a way to run 1000trades on linux?
thanks

Offline criptonauta

  • Contributor
  • **
  • Posts: 137
    • View Profile
Re: GUNBOT - Linux Tutorial
« Reply #9 on: April 25, 2017, 08:07:57 AM »
Thanks for the Tuto, J-Rodd  8)

A lot to learn yet but it's already functional and that's what matters ^^

   ✔ FAST, APPROVED AND EASY Escrow for used GunBot licenses @ 5% ..:..Gunbot licenses 10% off: 'Criptonauta_Gun' code. | Tuning, Custom Strats | No VPS? Get yours here   ✔

Offline docta

  • Rookie
  • *
  • Posts: 9
    • View Profile
Re: GUNBOT - Linux Tutorial
« Reply #10 on: April 30, 2017, 11:35:35 PM »
jerod thank you.  thank you thank you thank you thank you thank you!

this is just what i was looking for!  i don't know why it's so difficult for most people to give linux tutorials.  my reasons for never quite learning how to use this OS is tons of noise and not enough points of mental traction (in other words, i'm too stupid to follow their instructions).  seems that either you're already familiar with all the -nix particulars or you're on your own to figure it out lol. 

seriously...thanks
 -KW

Offline bney

  • Rookie
  • *
  • Posts: 33
    • View Profile
Re: GUNBOT - Linux Tutorial
« Reply #11 on: June 30, 2017, 02:20:26 PM »
What is the file name for the current 3.3.2 Poloniex bittrex patch version?

Offline AlfonseX

  • Contributor
  • **
  • Posts: 101
  • Trop de chefs, pas assez d'indiens !
    • View Profile
Re: GUNBOT - Linux Tutorial
« Reply #12 on: July 01, 2017, 12:10:13 AM »
What is the file name for the current 3.3.2 Poloniex bittrex patch version?

Filename is same for all three markets:
Code: [Select]
gunthy-linuxx32or
Code: [Select]
gunthy-linuxx64depends of your system.
If you think I helped you, give me a drink:
in btc: 12aeQSpytxoehCEptQE8tUJVVSAS42LvXo
in eth: 0x02a611f0c15bccdb6fa8e5e4b0692ff6d77852bd

Offline AI

  • Rookie
  • *
  • Posts: 21
    • View Profile
Re: GUNBOT - Linux Tutorial
« Reply #13 on: September 23, 2017, 08:03:49 AM »
Is this guide still up to date for 3.3.2?