Gunthy
GUNBOT: The automatic profit generator => Beginners & Help => Topic started by: densmirnov on June 09, 2017, 12:09:08 AM
-
Hi! As you might know, PM2 (http://pm2.keymetrics.io) is one of the best process managers for *nix right now. And it works perfectly with GunBot, but when you have multiple configs the process of starting new instance becames a bit complicated.
I've tried to make a simple solution, which allows you to start new GunBot instance (as long as you have PM2 installed and there is a config file present) with just a simple command (run it from gunbot folder): gunstart BTC_LSK poloniex !
This command will work exactly as this one: pm2 start -n BTC_LSK -o /home/gunbot/gunbot3/poloniex-BTC_LSK-log.txt -e /home/gunbot/gunbot3/poloniex-BTC_LSK-err.txt /home/gunbot/gunbot3/gunthy-linuxx64 -- BTC_LSK poloniex, which will start a new pm2 instance with config and error logs in correct places and will use correct gunbot version for your system architecture.
To install this command simply run curl -o- https://densmirnov.com/gunstart.sh | bash and voila — you will be able to use gunstart command. Actually all this is just a simple script, which adds new function to your ~/.bash_aliases
P.S. Keep in mind, that this is very early release, possible full of bugs and glitches. Use it on your risk! But feel free to fix or change anything!
-
I don't use PM2 (just a more process), and I use tmux to manage all my gunbot instances like this:
#!/bin/env bash
# start all *-config.js in a tmux new session
COMMAND="./gunthy-linuxx64"
flag="0"
for file in *-config.js; do
pair=$(echo $file | cut -d'-' -f2)
market=$(echo $file | cut -d'-' -f1)
if [[ "$flag" = "0" ]]; then
tmux -2 new-session -d -s gunbot -n $pair "$COMMAND $pair $market"
flag="1"
else
tmux -2 new-window -d -n $pair "$COMMAND $pair $market"
fi
printf "Launching %s %s " "$market" "$pair"
for i in {0..20}; do
echo -n "."
sleep 1
done
echo
done
echo Done
But you can simply launch all your config file (without using tmux) like this:
#!/bin/env bash
for file in *-config.js; do
pair=$(echo $file | cut -d'-' -f2)
market=$(echo $file | cut -d'-' -f1)
./gunthy-linuxx64 $pair $market
sleep 20
done
done
Save code in a file (like start.sh) and chmod u+x start.sh
then you can launch it with ./start.sh
Ok, PM2 is a great tool to keep an eye on your gunbots, but ps, top, htop, or my favorite glances (sudo pip install glances) don't eat my CPU.
My two cents ;)
Thank you for your work.