Username: Password:

Author Topic: [TUT] How to running GUNBOT in Linux  (Read 18994 times)

Offline Agent_5284159

  • Rookie
  • *
  • Posts: 5
    • View Profile
[TUT] How to running GUNBOT in Linux
« on: April 12, 2017, 05:05:02 PM »
Hi there, today I will show you guys how to running GUNBOT in Linux.
After this guide, I have faith that you can run GUNBOT in Linux without any problem.

Host and GUNBOT version

DigitalOcean  16.04.2 x64 (512MB)
GUNBOT        Beta 2.0.4 - Linux (x64)
NodeJS          v6.10.2
PM2              2.4.4

How to connect to the server

Windows User

For Windows User, I recommend to use putty as a SSH client, which can let you connect to your server. You can download it from here:

http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html



Just download putty and it should work~



Paste you VPS IP in the hostname field, then click Open, then enter your password(sent by Email(DigitalOcean))

After that you will has access to your VPS now.

Linux User

I believe that there is nothing you need to do, because you have SSH installed by default.



Just type the following line in your terminal, noted that you should replace 123.123.123.123 to your VPS IP

Code: [Select]
ssh 123.123.123.123
Now we are connecting to the server, time for the next move.

Install the packages that the GUNBOT needed

To run GUNBOT on the background, I'd perfer to use pm2, so we may need NodeJS to run pm2.
Don't worry, Just follow my lead~

Installing NodeJS

Type in your terminal

Code: [Select]
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
Then run

Code: [Select]
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"



After that, run

Code: [Select]
nvm install --lts


When you see this, which mean we have NodeJS installed.

Installing pm2

pm2 is an awesome process manager for NodeJS, also we can use it to run GUNBOT

Code: [Select]
npm install -g pm2
Installing unzip

Code: [Select]
apt install unzip


Let get GUNBOT running

To start with, we need to downlaod the bot first. Then we need to unzip it and move to a folder.
I'd like to move the all the file to /root/gunbot

Code: [Select]
wget https://github.com/GuntharDeNiro/BTCT/releases/download/Beta2.0.4lin/gunbotv2.0.4_linux_x86_x64.zip  # Download the GUNBOT
unzip gunbotv2.0.4_linux_x86_x64.zip                                                                                                            # Unzip
mv gunbotv2.0.4_linux_x86_x64/ gunbot/                                                                                                       # I perfer to use this folder
cd gunbot/                                                                                                                                                     # cd into the folder

You will have those file in the folder.



Now, we need to make the gunbot executable

Code: [Select]
chmod +x gunbot
Now we can edit the config file via nano, forget about the config name. We can consider BTC_DASH-config.js as a default config file.

Code: [Select]
nano BTC_DASH-config.js
Using →←↑↓ to locate, you want to save the file? Ctrl + x then y then Enter

We use cp to generate the config file. If you want to trade with BTC_ETH and BTC_ETC, just type

Code: [Select]
cp BTC_DASH-config.js BTC_ETH-config.js
cp BTC_DASH-config.js BTC_ETC-config.js

Now we need a gunbot.yaml file to start pm2

Code: [Select]
nano gunbot.yaml
Copy and paste the following line.

Code: [Select]
apps:
  - script : ./gunbot
    name : 'BTC_ETH'
    args : 'BTC_ETH'
  - script : ./gunbot
    name : 'BTC_ETH'
    args : 'BTC_ETH'
  - script : ./gunbot
    name : 'BTC_ETH'
    args : 'BTC_ETC'

You want to trade more pairs, just write them down in the same format

Now we come to the most excited moment, let start it~

Code: [Select]
pm2 start gunbot.yaml


Here we go~

How can I see the logs

Nice question, we need GUNBOT's log for analytics.

There are two ways for us to see the logs

[size=12]Viewing all logs in one place[/size]

Code: [Select]
pm2 monit


[size=12]Viewing a single paris logs[/size]

Example BTC_ETH

Code: [Select]
pm2 logs BTC_ETH
From here you can know why the bot restarted and the new logs.



----

Now, everything should work, good luck~

Offline jroddingham

  • Rookie
  • *
  • Posts: 16
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #1 on: April 14, 2017, 05:36:35 PM »
+1 for pm2 and a yaml config. I'll be using this instead of tmux I think.

Offline earendil

  • Rookie
  • *
  • Posts: 5
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #2 on: April 19, 2017, 09:00:07 PM »
Hi,
I followed the instructions, and I managed to install everything required and to download, unzip and set the running for Gunbot.
- However, I could not connect using ssh (ssh VPS IP). What does it refer to as 'vps ip'?
- Further, where should I include my API key and password for Poloniex?
Thanks!

Offline Pro

  • Rookie
  • *
  • Posts: 20
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #3 on: April 21, 2017, 02:28:58 AM »
Damn, Linux really sux>:(

And also this guide isn't complete!
There is even no config file to choose from and what to do there? (thinks the new user)

I had to really think and could only draw from my knowledge with windows.
and could only use those nice config files I already created with it.

You really should include the standart ones!

You didn't include how to control the bots.
Also how to stop this stupid pm2 program now.
I can't even get back to command line now.

Please add those things asap.  ??? ::)
« Last Edit: April 21, 2017, 02:33:21 AM by Pro »

Offline shacky

  • Rookie
  • *
  • Posts: 4
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #4 on: April 21, 2017, 07:15:37 AM »
control + c to stop de pm2 monit

ken

  • Guest
Re: [TUT] How to running GUNBOT in Linux
« Reply #5 on: April 21, 2017, 06:02:46 PM »
This may help with generating the yaml.

Code: [Select]
#!/bin/bash
if [ -z "$1" ]; then
        echo usage: $0 output [gunbot_path]
        exit
fi
FILE=$1
GBSCRIPT=${2:-gunbot}
if [ -f $FILE ]; then
        rm -rf $FILE
fi
echo apps: > $FILE
for i in $( ls *-config.js ); do
        IDX=`expr index "$i" -`
        PAIR=${i:0:$IDX-1}
        echo "- script : ./$GBSCRIPT" >> $FILE
        echo "  name : '$PAIR'" >> $FILE
        echo "  args : '$PAIR'" >> $FILE
done

Offline zurk

  • Rookie
  • *
  • Posts: 13
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #6 on: April 24, 2017, 01:31:54 PM »
I started GunBot X3 on CentOS7 using pm2. Here are the contents .yaml file:
Code: [Select]
apps:
  - script : ./index.js
    name : 'BTC_MAID'
    args : 'BTC_MAID poloniex'
BTC: 1GuBmfoRX9JJdGE6GzabLkb3WfNqRuTgic
telegram https://t.me/AlexeyTsurkan

ken

  • Guest
Re: [TUT] How to running GUNBOT in Linux
« Reply #7 on: April 25, 2017, 12:37:58 AM »
Here's an updated yaml generator script.  You'll probably have to make edits to the output, but this should still save some time typing.

Code: [Select]
#!/bin/bash
if [ -z "$1" ]; then
        echo usage: $0 output
        exit
fi
FILE=$1
if [ -f $FILE ]; then
        rm -rf $FILE
fi
echo apps: > $FILE
for i in $( ls *-config.js ); do
        IDX=`expr index "$i" -`
        PAIR=${i:0:$IDX-1}
        for name in poloniex kraken bittrex; do
                echo "- script : node" >> $FILE
                echo "  name : '$name : $PAIR'" >> $FILE
                echo "  args : 'index $PAIR $name'" >> $FILE
        done
done

Offline Vladee

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #8 on: April 25, 2017, 02:40:45 PM »
I started GunBot X3 on CentOS7 using pm2. Here are the contents .yaml file:
Code: [Select]
apps:
  - script : ./index.js
    name : 'BTC_MAID'
    args : 'BTC_MAID poloniex'

As a linux beginner I must say pm2 makes my life (gunbot life) much easier.  :) I still wonder how a command for starting gunbot X3 via command line look like (without using yaml)?

ken

  • Guest
Re: [TUT] How to running GUNBOT in Linux
« Reply #9 on: April 25, 2017, 03:58:25 PM »
As a linux beginner I must say pm2 makes my life (gunbot life) much easier.  :) I still wonder how a command for starting gunbot X3 via command line look like (without using yaml)?

Code: [Select]
node index BTC_ETH poloniexor per the example you quoted
Code: [Select]
./index BTC_MAID poloniex
Look at the yaml file, script is the file you wish to execute, so it reads as "node" or "./index" in the examples in this thread.  The second line is the pm2 process name.  This can be anything you want, it's just used as a reference.  I call mine something like "exchange : pair" or "poloniex : BTC_ETH."  The third line are the options passed in to the script executed in the first line.  This is where we tell gunbot which exchange and pair to use.

The script I posted will generate an output like this:
Quote
apps:
- script : node
  name : 'poloniex : BTC_ETH'
  args : 'index BTC_ETH poloniex'

Offline Vladee

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #10 on: April 25, 2017, 08:55:43 PM »
Thank you, ken, for such an explanatory answer! I feel being one step further in linux  :D

Offline serverleader

  • Rookie
  • *
  • Posts: 4
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #11 on: April 27, 2017, 04:17:52 AM »
Dude! thanks! !!!

Offline soyab0007

  • Rookie
  • *
  • Posts: 28
  • 10% discount with code "SOYAB" on GUNBOT License
    • View Profile
    • Tradingbotpro
Re: [TUT] How to running GUNBOT in Linux
« Reply #12 on: April 27, 2017, 01:52:00 PM »
Is there a SSH GUI client for windows?


Authorized GunBot Reseller

Offline dobcrypto

  • Contributor
  • **
  • Posts: 196
  • Russian - native language
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #13 on: April 28, 2017, 03:36:41 AM »
Is there a SSH GUI client for windows?
putty 0.68 =)

Offline bp423

  • Rookie
  • *
  • Posts: 2
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #14 on: May 04, 2017, 07:39:11 PM »
I am getting the following errors.  Can anyone assist?

0|BTC_ETH  | [ ----------------    2017/05/04 18:59:47       Gunbot v2.0.4 Beta cycle#18 ------------------------ ]
0|BTC_ETH  | ::::: collecting data...
0|BTC_ETH  | **showError******************* ERROR *****************************
0|BTC_ETH  | 2017/05/04 18:59:47 statusCode 422
0|BTC_ETH  | 2017/05/04 18:59:47 Error!!! statusCode 422
0|BTC_ETH  | !!! Cycle 19 failed. Will repeat in 3000s

In addition how do I specify that I want to use supergun?
« Last Edit: May 04, 2017, 08:05:01 PM by bp423 »

Offline Snapper_Head

  • Rookie
  • *
  • Posts: 4
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #15 on: May 04, 2017, 11:18:41 PM »
How do I exit out of the session and keep the bot running on the VPS ?

Offline Agent_5284159

  • Rookie
  • *
  • Posts: 5
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #16 on: May 05, 2017, 04:09:03 AM »
+1 for pm2 and a yaml config. I'll be using this instead of tmux I think.

Yep, I think pm2 is better than tmux. PM2 can restart the pair once they exit unexpectly.

Hi,
I followed the instructions, and I managed to install everything required and to download, unzip and set the running for Gunbot.
- However, I could not connect using ssh (ssh VPS IP). What does it refer to as 'vps ip'?
- Further, where should I include my API key and password for Poloniex?
Thanks!

VPS IP, I think you can contact your vps provider.
You can use nano to edit the config file, then write your api in it.

Damn, Linux really sux>:(

And also this guide isn't complete!
There is even no config file to choose from and what to do there? (thinks the new user)

I had to really think and could only draw from my knowledge with windows.
and could only use those nice config files I already created with it.

You really should include the standart ones!

You didn't include how to control the bots.
Also how to stop this stupid pm2 program now.
I can't even get back to command line now.

Please add those things asap.  ??? ::)

Sorry about it.

Config file can be generate using the following bash script. Save as xx.sh then work.

Code: [Select]
#!/bin/bash

echo "apps:"
for pair in `ls *-config.js | sed "s/\-config.js//g"`
do
        echo "  - script : stepgain.js"
        echo "    name : '$pair'"
        echo "    args : '$pair'"
done

This can help you to generate a stepgain config file.
Code: [Select]
bash xx.sh > gunbot.yaml Then should work.

To control the bot,
Code: [Select]
pm2 start/stop/restart BTC_ETH, to exit from monit,
Code: [Select]
Ctrl + c
Good luck

Offline Agent_5284159

  • Rookie
  • *
  • Posts: 5
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #17 on: May 05, 2017, 04:11:35 AM »
I am getting the following errors.  Can anyone assist?

0|BTC_ETH  | [ ----------------    2017/05/04 18:59:47       Gunbot v2.0.4 Beta cycle#18 ------------------------ ]
0|BTC_ETH  | ::::: collecting data...
0|BTC_ETH  | **showError******************* ERROR *****************************
0|BTC_ETH  | 2017/05/04 18:59:47 statusCode 422
0|BTC_ETH  | 2017/05/04 18:59:47 Error!!! statusCode 422
0|BTC_ETH  | !!! Cycle 19 failed. Will repeat in 3000s

In addition how do I specify that I want to use supergun?

Check this pls: https://gunthy.org/index.php?topic=65.0

How do I exit out of the session and keep the bot running on the VPS ?

After you let gunbot running in pm2, just exit the SSH and gunbot will still running on the VPS,

Offline Snapper_Head

  • Rookie
  • *
  • Posts: 4
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #18 on: May 07, 2017, 04:30:06 PM »
I am a little confused. Version 2.04

Quote
Porting back 1000trades and Best currencies for linux users: start them with node 1000trades BTC_ETH or node currencies. Config files for 1000trades and Best currencies are config.js and params.js
This says to start with node 1000trades BTC_ETH
but when I open the config.js the top line is

   COINS_PAIR:   'BTC_ETC',
   KEY: '',
   SECRET: '',
   
How do I add other pairs  to trade ? Do I just add them in the   COINS_PAIR:   'BTC_ETC',   or do I have to create more config files


Offline Nistap

  • Rookie
  • *
  • Posts: 3
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #19 on: May 09, 2017, 11:25:44 AM »
I have exactly the same question. As the release notes state that the supergun and 1000trades are configured with config.js and params.js.

For me it is totally unclear how to define multiple coin pairs.

Is it a combination of config.js, params.js and BTC_XXX-config.js?

Is it possible to define multiple pairs in the "COINS_PAIR" keyword in the config.js file.\

I've been looking in several forums and can't find the answer (Maybe I've looked in the wrong places, but until now I have not found any useful information)
« Last Edit: May 09, 2017, 12:15:31 PM by Nistap »

Offline throwaway

  • Rookie
  • *
  • Posts: 1
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #20 on: May 09, 2017, 07:38:39 PM »
Really is quite frustrating. You would hope that since polo is giving so much trouble, someone would do a complete tutorial on how to start these different strategies.

I have downloaded 2.0.4 because of this tutorial and still can't get it. In the config.js that is supposed to be for 1000trades there are no settings just a spot for the key. I have seen answers saying to do node 1000trades BTC_XXX
So does this mean that you are just putting different numbers in the settings ? So put the same numbers in all the buy settings and sell settings?

Very hard to get answers in the telegram. I agree with the earlier post that we need clear installation instructions. I have read through all of the changelogs and still can't figure it out.

Offline jung

  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #21 on: May 14, 2017, 03:55:37 PM »
 # Unzip
unzip:  cannot find or open gunbotv2.0.4_linux_x86_x64.zip, gunbotv2.0.4_linux_x86_x64.zip.zip or gunbotv2.0.4_linux_x86_x64.zip.ZIP.
root@gunbot-1gb-fra1-01:~# mv gunbotv2.0.4_linux_x86_x64/ gunbot/                                                                                                       # I perfer to use this folder
mv: cannot stat 'gunbotv2.0.4_linux_x86_x64/': No such file or directory


I stilll recive that error

Offline dyvosvit

  • Rookie
  • *
  • Posts: 30
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #22 on: May 19, 2017, 07:22:20 PM »
Thank you very much Agent_5284159 for this guide!
Everything works fine on headless linux vps.
Just wanted to add, almost the same script you guys were showing here for creating yaml file, but i wanted to use a different approach: instead of creating yaml-file from all of the configs in the directory, i've decided to create yaml only for the pairs i want to start. So, i've modified your xx.sh script to parse another file named 'currencies.txt', where i would put just the names of coins i want my gunbot to work with.
So, here's script (linux x64, gunbot 3.2), for those who wants a bit different usage of pm2:
Code: [Select]
#!/bin/bash

echo "apps:"
for pair in `cat ./currencies.txt | tr "\n" " "`
do echo " - script : ./gunthy-linuxx64"
do echo " name : '$pair'"
do echo " args : BTC_$pair poloniex"
done

Offline Xaos

  • Rookie
  • *
  • Posts: 14
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #23 on: May 23, 2017, 05:12:30 AM »
we need this instructions for Gunbot 3.2

with pm2

Offline ruphus

  • Rookie
  • *
  • Posts: 68
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #24 on: May 30, 2017, 10:24:13 AM »
When I follow your instrucitons on my raspberry pi (running raspbian - kernel 4.9 armv7) i get the following error after running pm2 start gunbot.yaml:



My gunbot.yaml file looks like:
Code: [Select]
apps:
  - script : ./gunbot
    name : 'BTC_ETH'
    args : 'BTC_ETH'
  - script : ./gunbot
    name : 'BTC_ETC'
    args : 'BTC_ETC'
  - script : ./gunbot
    name : 'BTC_DASH'
    args : 'BTC_DASH'
  - script : ./gunbot
    name : 'BTC_DCR'
    args : 'BTC_DCR'
  - script : ./gunbot
    name : 'BTC_FCT'
    args : 'BTC_FCT'
  - script : ./gunbot
    name : 'BTC_GNT'
    args : 'BTC_GNT'
  - script : ./gunbot
    name : 'BTC_LSK'
    args : 'BTC_LSK'
  - script : ./gunbot
    name : 'BTC_LTC'
    args : 'BTC_LTC'
  - script : ./gunbot
    name : 'BTC_STRAT'
    args : 'BTC_STRAT'
  - script : ./gunbot
    name : 'BTC_XMR'
    args : 'BTC_XMR'

Within the pair-config-files I mainly inserted my API key and secret.

Any help on this?

Offline pookNast

  • Rookie
  • *
  • Posts: 5
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #25 on: June 08, 2017, 04:21:44 PM »
Thanks for this tutorial, extremely helpful for the 'nix crowd on here.

Questions pertaining to getting pairs loaded up through the pm2 module on the bittrex exchange:

1) How would I load a pair on the bittrex exchange using the pm2 module? I would need to have a separate bittrex-BTC_XXX-config.js from the polo config?

2) Could I run the same pair on polo and bit simultaneously on pm2 with the separate config files? (i.e. BTC_XXX on polo & BTC_XXX on bit)

3) I'm trying to add an ETH_XXX pair through the 'pm2 start ETH_XXX' the config files are in the correct directory, but I'm receiving the error 'Script not found' per the screenshoot. Any suggestions on what I am doing wrong so I can get that to work?
« Last Edit: June 08, 2017, 04:52:12 PM by pookNast »

Offline Spythe

  • Rookie
  • *
  • Posts: 10
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #26 on: July 20, 2017, 01:12:56 AM »
Great guide. I started this afternoon with a macOS version and just installed a DigitalOcean 2GB droplet // 20$ and used your guide to get it up and running in about 20 minutes. I'm not experienced with Gunbot at all, but I did knew a few SSH lines since I already use VPS's for my websites.

I've used the default config file, but changed the budget (0.01 → 0.025) and set it up to work with 15 pairs. Can't say it works or doesn't, but it's running right now. But the ease of it.. it's great! And I'm glad this can run in the background, even when the SSH connection is down.

Anyway, it's now 02:10 here, so I'll check back tomorrow how Gunbot performed (although it's market related..).

But one point: Update your guide. There are a number of changes since (at least) gunbot 3.3.2, including naming the market in the argument (e.g. ARGS : BTC_DASH bittrex). And there is a typo and double paste in your example of your gunbot.yaml file. Just reread your post and update for new users. These guides are great, since there is a huge gap between buying gunbot and actually setting it up, especially on a VPS.

Offline Spythe

  • Rookie
  • *
  • Posts: 10
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #27 on: July 20, 2017, 04:30:06 PM »
Any chance you can tell me how to add a new coin pair while PM2 is running? I'm running 17 pairs successfully on a DigitalOcean 2GB Ubuntu VPS, but launching 18 bots will crash the memory. At start up, they all use an increased amount of memory and once they had their first run, memory will be freed again. With 17 bots at launch, I only have about 60MB ram left. However, letting it spin for 5 minutes frees up about 300-400 MB of RAM. Although I could let it have that, I could start a new pair. But only if PM2 and a few bots are already running.

So therefor I was wondering: How do I add a new task to a running PM2 set of tasks?

Oh, and a second question: Is there a way to include the allpairs-config.js file to overrule settings of all pairs with a single file? :) That would be nice.
Update: The single config files are already told to include the all pairs file, so when you adjust that file PM2 automatically gets updated with the new files.. nice ;)
« Last Edit: July 20, 2017, 04:32:47 PM by Spythe »

Offline flengure

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #28 on: September 13, 2017, 12:20:22 PM »
This seems to work for me

1. make sure you have a config.js for the pair
 just copy an existing one and rename replacing the BTC_XXX part of the name

2. run the following command

pm2 start ./gunthy-linuxx64 --name "BTC_LGD_B" -- BTC_LGD bittrex

this will start the BTC_LGD pair on bittrex

to delete a pair

pm2 delete BTC_LGD_B

Corrections welcome

Offline talesfromthecrypto

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #29 on: September 19, 2017, 08:54:40 AM »
Has anyone devised a way to easily track the bots performance over time?

Offline albatros24

  • Rookie
  • *
  • Posts: 26
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #30 on: September 21, 2017, 03:32:06 PM »
Hello,

trying to set-up Gunbot 3.3.2 in Linux Mint 18.2 but when i run the bot with pm2 and check the log for the pair I get this output:

Quote
    Bot crashed at 2017/09/21 15:47:52
    Reason: Failed to load config!!!
    Parameter: undefined-BTC_XRP-config.js
    Original error: { Error: Cannot find module '/home/albatros/Programi/gunbot/undefined-BTC_XRP-config.js'
        at Module._resolveFilename (module.js:470:15)
        at Function.Module._resolveFilename (evalmachine.<anonymous>:0:0)
        at Function.Module._load (module.js:418:25)
        at Module.require (module.js:498:17)
        at Module.require (evalmachine.<anonymous>:0:0)
        at require (internal/module.js:20:19)
        at loadConfig (evalmachine.<anonymous>:0:0)
        at new Bot (evalmachine.<anonymous>:0:0)
        at Object.console./snapshot/Users/Enrico/Desktop/xBot_v2.9.3/index.js.dev (evalmachine.<anonymous>:0:0)
        at Module._compile (evalmachine.<anonymous>:0:0)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32)
        at tryModuleLoad (module.js:447:12)
        at Function.Module._load (module.js:439:3)
        at Module.runMain (evalmachine.<anonymous>:0:0)
        at run (bootstrap_node.js:426:7)
        at startup (bootstrap_node.js:147:9)
        at bootstrap_node.js:541:3 code: 'MODULE_NOT_FOUND' }


Any help would be appreciated!

Offline albatros24

  • Rookie
  • *
  • Posts: 26
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #31 on: September 21, 2017, 05:26:26 PM »
Hello,

trying to set-up Gunbot 3.3.2 in Linux Mint 18.2 but when i run the bot with pm2 and check the log for the pair I get this output:

Quote
    Bot crashed at 2017/09/21 15:47:52
    Reason: Failed to load config!!!
    Parameter: undefined-BTC_XRP-config.js
    Original error: { Error: Cannot find module '/home/albatros/Programi/gunbot/undefined-BTC_XRP-config.js'
        at Module._resolveFilename (module.js:470:15)
        at Function.Module._resolveFilename (evalmachine.<anonymous>:0:0)
        at Function.Module._load (module.js:418:25)
        at Module.require (module.js:498:17)
        at Module.require (evalmachine.<anonymous>:0:0)
        at require (internal/module.js:20:19)
        at loadConfig (evalmachine.<anonymous>:0:0)
        at new Bot (evalmachine.<anonymous>:0:0)
        at Object.console./snapshot/Users/Enrico/Desktop/xBot_v2.9.3/index.js.dev (evalmachine.<anonymous>:0:0)
        at Module._compile (evalmachine.<anonymous>:0:0)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32)
        at tryModuleLoad (module.js:447:12)
        at Function.Module._load (module.js:439:3)
        at Module.runMain (evalmachine.<anonymous>:0:0)
        at run (bootstrap_node.js:426:7)
        at startup (bootstrap_node.js:147:9)
        at bootstrap_node.js:541:3 code: 'MODULE_NOT_FOUND' }


Any help would be appreciated!


Ok, I managed to get it working. I am new to Linux so any advice and/or corrections are appreciated.

The problem was that the 3.3.2 version has different naming conventions (I think). So, I did the following:

1. I created the following .config file: 'bittrex-BTC_AMP-config.js' and edited it appropriately (entered my API key, set the trading strategy etc.)

2. The executable for my OS (Linux Mint 18.2 64-bit) is named 'gunthy-linuxx64'. So, when creating .yaml file for pm2, i named it 'gunthy-linuxx64.yaml".

3. Inside the gunthy-linuxx64.yaml file I entered the following:


apps:
  - script : ./gunthy-linuxx64
    name : 'BTC_XRP'
    args : 'BTC_XRP bittrex'


As I understand, the 'name' argument is the name that will be shown in the list of running processes when you start Gunbot with pm2. So if you named it for example 'chair', pm2 would have a process named 'chair'. The 'args' argument is the part that tells Gunbot to run the .config file named 'bittrex-BTC_AMP-config.js'.

So that started my Gunbot and got it working.




Offline albatros24

  • Rookie
  • *
  • Posts: 26
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #32 on: September 21, 2017, 05:28:45 PM »
Hello,

trying to set-up Gunbot 3.3.2 in Linux Mint 18.2 but when i run the bot with pm2 and check the log for the pair I get this output:

Quote
    Bot crashed at 2017/09/21 15:47:52
    Reason: Failed to load config!!!
    Parameter: undefined-BTC_XRP-config.js
    Original error: { Error: Cannot find module '/home/albatros/Programi/gunbot/undefined-BTC_XRP-config.js'
        at Module._resolveFilename (module.js:470:15)
        at Function.Module._resolveFilename (evalmachine.<anonymous>:0:0)
        at Function.Module._load (module.js:418:25)
        at Module.require (module.js:498:17)
        at Module.require (evalmachine.<anonymous>:0:0)
        at require (internal/module.js:20:19)
        at loadConfig (evalmachine.<anonymous>:0:0)
        at new Bot (evalmachine.<anonymous>:0:0)
        at Object.console./snapshot/Users/Enrico/Desktop/xBot_v2.9.3/index.js.dev (evalmachine.<anonymous>:0:0)
        at Module._compile (evalmachine.<anonymous>:0:0)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32)
        at tryModuleLoad (module.js:447:12)
        at Function.Module._load (module.js:439:3)
        at Module.runMain (evalmachine.<anonymous>:0:0)
        at run (bootstrap_node.js:426:7)
        at startup (bootstrap_node.js:147:9)
        at bootstrap_node.js:541:3 code: 'MODULE_NOT_FOUND' }


Any help would be appreciated!


Ok, I managed to get it working. I am new to Linux so any advice and/or corrections are appreciated.

The problem was that the 3.3.2 version has different naming conventions (I think). So, I did the following:

1. I created the following .config file: 'bittrex-BTC_XRP-config.js' and edited it appropriately (entered my API key, set the trading strategy etc.)

2. The executable for my OS (Linux Mint 18.2 64-bit) is named 'gunthy-linuxx64'. So, when creating .yaml file for pm2, i named it 'gunthy-linuxx64.yaml".

3. Inside the gunthy-linuxx64.yaml file I entered the following:


apps:
  - script : ./gunthy-linuxx64
    name : 'BTC_XRP'
    args : 'BTC_XRP bittrex'


As I understand, the 'name' argument is the name that will be shown in the list of running processes when you start Gunbot with pm2. So if you named it for example 'chair', pm2 would have a process named 'chair'. The 'args' argument is the part that tells Gunbot to run the .config file named 'bittrex-BTC_AMP-config.js'.

So that started my Gunbot and got it working.

After checking the logs using 'pm2 logs BTC_XRP' command, I noticed the following errors:

0|BTC_XRP  | (node:8521) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
0|BTC_XRP  | (node:9057) DeprecationWarning: Calling an asynchronous function without callback is deprecated.

Does anyone know what the errors mean and how to fix them?



Edit: It's 'bittrex-BTC_XRP-config.js', not 'bittrex-BTC_AMP-config.js'
« Last Edit: September 21, 2017, 05:35:11 PM by albatros24 »

Offline AI

  • Rookie
  • *
  • Posts: 21
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #33 on: September 23, 2017, 02:54:13 PM »
if you would power off your vps to do an upgrade what steps would be needed to taken again on powering it on? will everything be still in place and can i just run?

Code: [Select]
pm2 start gunthy-linuxx64.yaml

Offline Milan

  • Rookie
  • *
  • Posts: 11
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #34 on: September 29, 2017, 09:33:28 AM »
Yes, you should be able just to run. I did reinstall the system and there of course I had to start all over again. But with an upgrade, you should be able to continue normally.
However, I cannot figure out a way to keep the bot running after the terminal is closed. I googled and found "nohoop" command and "disown" but they still didn't help. Maybe because I run the boot as root? Any idea?

Offline albatros24

  • Rookie
  • *
  • Posts: 26
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #35 on: October 15, 2017, 02:27:13 PM »
Yes, you should be able just to run. I did reinstall the system and there of course I had to start all over again. But with an upgrade, you should be able to continue normally.
However, I cannot figure out a way to keep the bot running after the terminal is closed. I googled and found "nohoop" command and "disown" but they still didn't help. Maybe because I run the boot as root? Any idea?

Isn't that the purpose of PM2? To keep the bot running in the background at all times?

Offline liberspirita

  • Rookie
  • *
  • Posts: 10
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #36 on: November 26, 2017, 09:20:08 PM »
Hi,
I have managed to run on nodejs
but i have nothing else on logs :

jerome@cresus:~/GUNBOT$ pm2 logs BTC_LSK
[TAILING] Tailing last 15 lines for [BTC_LSK] process (change the value with --lines option)
/home/jerome/.pm2/logs/BTC-LSK-error-2.log last 15 lines:
/home/jerome/.pm2/logs/BTC-LSK-out-2.log last 15 lines:
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex



I was not sure gunbot was doing anything, now i'm confident gunbot is doing nothing !

Offline albatros24

  • Rookie
  • *
  • Posts: 26
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #37 on: December 03, 2017, 01:19:53 PM »
Hi,
I have managed to run on nodejs
but i have nothing else on logs :

jerome@cresus:~/GUNBOT$ pm2 logs BTC_LSK
[TAILING] Tailing last 15 lines for [BTC_LSK] process (change the value with --lines option)
/home/jerome/.pm2/logs/BTC-LSK-error-2.log last 15 lines:
/home/jerome/.pm2/logs/BTC-LSK-out-2.log last 15 lines:
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex
2|BTC_LSK  | Loading config...
2|BTC_LSK  | Loading exchange bittrex



I was not sure gunbot was doing anything, now i'm confident gunbot is doing nothing !

Check your config files for any formatting errors (spaces, missing commas etc.-anything that is not in line with standard config file formatting)7

Offline Urosp

  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: [TUT] How to running GUNBOT in Linux
« Reply #38 on: January 09, 2018, 06:25:10 PM »
Is there any tutorial for Linux for latest Gunbot 7?

I believe all this is not needed since node is included?

Im running it on Linux but with problems, no trading, can't find any log files,...