Username: Password:

Author Topic: [HOWTO] Gunbot RPM for Mageia  (Read 18948 times)

dlucio

  • Guest
[HOWTO] Gunbot RPM for Mageia
« on: July 23, 2017, 01:41:10 PM »
From my personal blog: http://inside-out.xyz/technology/gunbot-rpm-definition-for-mageia.html

If you do not know, I have been contributing for Mageia since the beginning of this awesome distribution. As a system administrator, one of my biggest concerns is having an easy and repeatable deployment method, hence I am an RPM fan. I have published in the More RPM'ss for Mageia project the RPM SPEC with some source definitions. For those who wonder why here and not in the main distribution, it is simple. This is not an open source project and the way it works, it violates many RPM policies. So, I prefer saving the Mageia team rejection and publish it as an alternative.

Some quick directions how to produce the RPM yourself. I will assume you are familiar with RPM and Linux command line:

  • create your rpm directory mkdir ~/rpmbuild/gunbot/{SPECS,SOURCES}
  • download the proper SPEC and SOURCE from the More RPM's for Mageia GitHub page. Put them inside proper directories
  • download gunbot zipball from Gunbot GitHub page. Put the zipball inside SOURCES directory
    the SPEC file is configured for release 3.3.2, but if there is a new release, edit the SPEC to meet the file names
  • from the ~/rpmbuild/gunbot directory, run bm -la. This command will produce the SRPM and the RPM for you
  • install with urpmi the final RPM
This SPEC could work out of the box for CentOS 7. But I haven't tried it. Since I got my trading server with Mageia I do not have the need to do it.

The RPM will put things under /opt/gunbot/. There will be a systemd unit available. For example, if you are going to trade the pair BTC_ETH under Poloniex, do the following:

  • create your poloniex-BTC_ETH-config.js file and save it under the /opt/gunbot/ directory.
  • make sure the user gunbot will have reading privileges, you can do this with the chown gunbot.gunbot poloniex-BTC_ETH-config.js command. Usually, you do not need to do this.
  • verify that the /opt/gunbot/ directory has write privileges for the gunbot user. The RPM will do this for you, but just in case.
  • enable the system unit by typing systemctl enable gunbot@poloniex-BTC_ETH
  • start it by typing systemctl start gunbot@poloniex-BTC_ETH

Enjoy your trading!

Additionally, I offer to do SRPM or the binary RPM for you for a minimum 0.0185 B (Text me if interested). Trust me, using the systemd makes your Linux management happier.

Offline MagicDude4Eva

  • Rookie
  • *
  • Posts: 13
    • View Profile
Re: [HOWTO] Gunbot RPM for Mageia
« Reply #1 on: December 31, 2017, 03:30:28 PM »
Hi there, hoping that you are still around.

I am trying to do this on a RaspberryPi and systemd is working, but Gunbot in CLI mode seems to only log then into systemd which does not provide colors etc. Is there any way to log into a separate file? At the moment I am using screen to have some logging.

Code: [Select]
[Unit]
Description=GunBot Service
After=network.target remote-fs.target nss-lookup.target
 
[Service]
User=pi
Group=pi
Type=simple
WorkingDirectory=/home/pi/gunbot/GunbotArm
ExecStart=/home/pi/gunbot/GunbotArm/gunthy-arm
ExecStop=/usr/bin/kill \$(/run/gunbot.pid)
PIDFile=/run/gunbot.pid
Restart=on-abort
 
[Install]
WantedBy=multi-user.target