Configuring your miner to work with Rig Manager

Rig Manager is meant to be a very flexible miner where almost any mining software can report status using simple HTTP(s) messages.  We provide some examples that you can use for common miners here along with detail as to how you can integrate your own platform for monitoring.

In order for Rig Manager to report workers as online continually we recommend that updates be sent for workers once every 5-15 minutes.

On This Page:

Multi Pool Miner

Multi Pool Miner (MPM) is a multi-algo, multi-pool, mult-device (NVIDIA, AMD, CPU) miner control software for Windows.  To use Rig Manager with MPM set the key you use in MPM in settings and change the -minerstatusurl in MPM’s start.bat from:
https://multipoolminer.io/monitor/miner.php
to:
https://www.rigmanager.xyz/mpm.php

CCMiner

This example PowerShell script was tested using CCMiner Zealot on Windows with a single GPU.  This example assumes mining on NiceHash and uses their API to determine the current revenue rate/day, it then uses the CoinBase API to convert to USD.

If you’re on windows you’ll first need to install Netcat for Windows.  If you’re running on Linux you’ll need to first install PowerShell for Linux and modify the script to use “netcat” rather than “ncat”.

To use this you also need to ensure the CCMiner API is enabled (-b 127.0.0.1:4068).

$serveraddress = '127.0.0.1'
$serverport = '4068'
$userid = '[your userid]'
$mworker = '[your worker]'
$workerkey = '[your worker key]'

$status = echo 'summary' | ncat $serveraddress $serverport #using ncat for Windows, replace with netcat if Linux
$statusname = $status.Split(';')[0]
$miner = $statusname.Split('=')[1]
$hashratestring = $status.Split(';')[5]
if ($hashratestring.Split('=')[0] -like 'HS') {
$hashrate = $hashratestring.Split('=')[1]
} elseif ($hashratestring.Split('=')[0] -like 'KHS') {
$hashrate = $hashratestring.Split('=')[1]/1 * 1000
} elseif ($hashratestring.Split('=')[0] -like 'MHS') {
$hashrate = $hashratestring.Split('=')[1]/1 * 1000000
} elseif ($hashratestring.Split('=')[0] -like 'GHS') {
$hashrate = $hashratestring.Split('=')[1]/1 * 1000000000
} elseif ($hashratestring.Split('=')[0] -like 'THS') {
$hashrate = $hashratestring.Split('=')[1]/1 * 1000000000000
}

$poolinfo = echo 'pool' | ncat $serveraddress $serverport #using ncat for Windows, replace with netcat if Linux
$poolstring = $poolinfo.Split(';')[0]
$pooladdr = $poolstring.Split('=')[1]
$poolalgo = $poolinfo.Split(';')[1]
$algo = $poolalgo.Split('=')[1]

#Get Power and Temperature from the Miner
$threadinfo = echo 'threads' | ncat $serveraddress $serverport #using ncat for Windows, replace with netcat if Linux
$tempstring = $threadinfo.Split(';')[3]
$tempc = $tempstring.Split('=')[1]
$wattstring = $threadinfo.Split(';')[4]
$watts = $wattstring.Split('=')[1] / 1000
$hashratestring = $threadinfo.Split(';')[11]

#Get the current profitability
$nhmulti = Invoke-WebRequest -Uri https://api.nicehash.com/api?method=simplemultialgo.info -UseBasicParsing
$nhjson = ConvertFrom-Json $nhmulti.content
$algorev = $nhjson.result.simplemultialgo | Where-Object name -like $algo #todo, create some error handling here in case there is not a match
$btc_revenue = $hashrate * $algorev.paying / 1000000000
$cbbtcusd = Invoke-WebRequest -uri https://api.pro.coinbase.com/products/BTC-USD/ticker -UseBasicParsing
$cbjson = ConvertFrom-Json $cbbtcusd.content
$fiat_revenue = $btc_revenue * $cbjson.price


Invoke-RestMethod -Uri https://www.rigmanager.xyz/rig.php -Method Post -Body @{userid = $userid; worker = $mworker; workerkey = $workerkey; pool = $pooladdr; miner = $miner; algo = $algo; hashrate = $hashrate; temp = $tempc; watts = $watts; btc_revenue = $btc_revenue; fiat_revenue = $fiat_revenue} -UseBasicParsing

Bminer

Bminer is a miner optimized for NVIDIA.  The easiest way to report to Rig Manager with Bminer is to enable Bminer’s api (-api 127.0.0.1:1880) then run a local script to query that api and report to Rig Manager.

Below is an example PowerShell script on Windows with a single NVIDIA card that connects to the Bminer api and reports status.  Using this example you could configure a scheduled task to run every ~5-10 minutes.

$userid = '[youruserid]'
$mworker = '[yourworkername]'
$workerkey = '[yourworkerkey]'
$mpool = '[yourpoolname]'
$miner = 'Bminer'

$report = Invoke-WebRequest -Uri http://localhost:1880/api/status -Method get -UseBasicParsing | Select-Object -Property Content
$report2 = $report.Content | ConvertFrom-Json
$worker = $report2.miners.0 | Select-Object -Property device
$solver = $report2.miners.0 | Select-Object -Property solver

Invoke-RestMethod -Uri https://www.rigmanager.xyz/rig.php -Method Post -Body @{userid = $userid; worker = $mworker; workerkey = $workerkey; pool = $mpool; miner = $miner; algo = $report2.algorithm; hashrate = $solver.solver.solution_rate; temp = $worker.device.temperature; watts = $worker.device.power} -UseBasicParsing

SiaCoin Hosting

Okay, so slight bit of a hack on this one as if you’re doing file hosting for Sia (as opposed to mining) there is no algorithm or hashrate.  For this example I’m using the amount of data stored in the hashrate field and the description “Storage Used” in the algorithm field.

As a bonus I’m also using the brilliant CoinMarketCap PowerShell module which gets the exchange rates for Sia to determine the current projected revenue in BTC and USD.

$userid = '[your_user_id]'
$worker = '[your_worker]'
$workerkey = '[your_workerkey]'
$algo = 'Storage Used'

$siahost = [path_to]\siac.exe host
$siaversion = [path_to]\siac.exe version
if ($siahost[1] -like '*Host appears to be working*') {
Write-Host 'Things are working, reporting in'
$miner = "Sia " + $siaversion[1].trim()

$seperator = "(",")"
$storagestring = $siahost[3].Split($seperator)[1]
$storageqty = $storagestring.Split(' ')[0]
$storagescale = $storagestring.Split(' ')[1]

if ($storagescale -like 'MB') {
$storageused = $storageqty/1 * 1000000
} elseif ($storagescale -like 'GB') {
$storageused = $storageqty/1 * 1000000000
} elseif ($storagescale -like 'TB') {
$storageused = $storageqty/1 * 1000000000000
}

Import-Module CoinMarketCap

$siaprice = Get-Coin -CoinId siacoin
$usd_revenue = $siaprice.price_usd/1 * $siahost[8].Split(' ')[3] / 30
$btc_revenue = $siaprice.price_btc/1 * $siahost[8].Split(' ')[3] / 30

Invoke-RestMethod -Uri https://www.rigmanager.xyz/rig.php -Method Post -Body @{userid = $userid; worker = $worker; workerkey = $workerkey; algo = $algo; miner = $miner; hashrate = $storageused; fiat_revenue = $usd_revenue; btc_revenue = $btc_revenue} -UseBasicParsing

} else {
Write-Host 'Sia hosting is not working, exiting'
}

SmartCash SmartNodes

SmartCash SmartNodes are the SmartCash network’s version of MasterNodes. You’ll need to install PowerShell on your SmartNode server and edit/save the below script as a .ps1 file. From there you can setup a cronjob (pwsh path_to_script.ps1).

$userid = '[your_user_id]'
$worker = '[your_worker]'
$workerkey = '[your_workerkey]'
$algo = 'SmartNode'
$block_target = 55*2

#Validate smartcash is running and masternode status is healthy
$mnstatus = smartcash-cli smartnode status
$mnstatusj = $mnstatus | ConvertFrom-Json

IF ($mnstatusj.status -eq 'Smartnode successfully started') {
Write-Host 'Your MasterNode appears to be working so I will check in'

$blocknum = smartcash-cli getblockcount
$block_reward = (5000*143500/[int]$blocknum)*(10/100)*2

$mnc = smartcash-cli smartnode count enabled
$dailypayouts = 86400/$block_target/[int]$mnc
$dailycoins = $block_reward/1 * $dailypayouts

$usd_revenue = (Invoke-WebRequest -Uri 'https://api.coingecko.com/api/v3/simple/price?ids=smartcash&vs_currencies=USD' -UseBasicParsing | ConvertFrom-Json).smartcash.usd * $dailycoins
$btc_revenue = (Invoke-WebRequest -Uri 'https://api.coingecko.com/api/v3/simple/price?ids=smartcash&vs_currencies=BTC' -UseBasicParsing | ConvertFrom-Json).smartcash.btc * $dailycoins

Invoke-RestMethod -Uri https://www.rigmanager.xyz/rig.php -Method Post -Body @{userid = $userid; worker = $worker; workerkey = $workerkey; algo = $algo; coin_revenue = $dailycoins; fiat_revenue = $usd_revenue; btc_revenue = $btc_revenue} -UseBasicParsing
} ELSE {
Write-Host 'Your MasterNode does not appear to be working, go fish'
}

Custom Monitoring

Rig Manager is designed to accept HTTP/S messages using either POST or GET with your provided status variables.  Very few variables are required (only your userid, the worker name and a generated worker security key), which makes it easy to integrate with miners that do not support some attributes.

The monitoring endpoint is:
https://www.rigmanager.xyz/rig.php

Our currently supported attributes are as follows.  These should be included with every request in either Post (recommended) or Get variables:

AttributeDescriptionDetail
userid [required]Your registered userid, this can be found on the top of every page and is required with every status update so that they can be linked to your accountstring
max length: 64
worker [required]The worker which you have specified in settings is required in each update so it can be associated with the mining rig.
If you run multiple miners on a single rig or want to associate multiple updates with a single worker you can add a “.” and your desired moniker (i.e. workera.1, workera.2, etc.)
string
max length: 45
workerkey [required]Your worker key is generated automatically when you create your worker and can be found in settings .  For security purposes you must submit this worker key with each update.
NOTE: You should secure this worker key like you would a password as anyone who has this key could submit updates for your rigs without your consent
string
length auto
poolThe mining pool your worker is currently connected tostring
max length: 45
minerThe mining application your worker is currently running (i.e. “ccminer”)string
max length: 45
algoThe algorithm(s) your miner is currently runningstring
max length: 45
hashrateYour current hash (or solution) rate per secondinteger
max length: 14
wattsThe worker’s current watts consumedinteger
max length: 6
temphardware temperature (degrees Celsius)integer
max length: 3
coin_revenueYour worker’s estimated revenue per day in the native coin/token
decimal
max length: 12.2
fiat_revenueYour worker’s estimated revenue per day in your desired fiat currencydecimal
max length: 12.2
btc_revenueYour worker’s estimated revenue per day in BTCdecimal
max length: 8.8
debug_enabledFor debugging purposes, if set to ‘1’ the response will output what has been receivedN/A