View on GitHub

miner_watchdog

A client part of application for monitoring cryptocurrency miners written in Python.

Miner Watchdog

This repository contains source code for client part of a Python application for monitoring Claymore miner. Basically it periodically connects to miner, gets hashrate and other data and sends them to monitoring server.

With some tweaks (installing new Python and two Python packages), this software may run on the miner itself. In this case, it will automatically restart it on low hashrate or internet problems.

Installing (on Linux)

Copy files to miner machine.

Edit /etc/rc.local so client.py is automatically executed when computer boots up. Change <full_path> to full path to client and log directory respectively. Change <user> to user name with rights to restart a computer (on EthOS, use ethos).

su - c "python3.5 <full_path>/client.py > <full_path>/logs/output.txt 2>&1 &" - <user>

Install pip:

curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py -o get-pip.py

and then run:

sudo python3.5 get-pip.py

Install python developer package:

sudo apt-get-ubuntu install python3.5-dev

Install twisted and requests packages

sudo pip3.5 install twisted requests

If you haven’t done it yet, change timezone. Full list of valid values may be listed with timedatectl list-timezones.

timedatectl set-timezone <TimeZone>

In the admin section of monitoring server, generate a secret for this client.

Allow monitoring in claymore’s configuration. Add following parameter to it’s configuration with selected port.

-mport <PORT>

Edit file config.ini and fill everything with valid values.

Restart computer.

Configuration

Each client comes with a config.ini file for configuration. Full list of keys follows:

[server]

All keys related to server belongs under this header.

[client]

Example Configuration

[server]
address=https://api.server.com

[client]
name=Miner
hashrate=123456789
interval=300
port=36879
host=localhost
secret=f65sad98a7we9f84asd65678hjkj