Username: Password:

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

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: 19
    • 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: 19
    • 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,...