Increase your income with Hive. Invite your friends and earn real cryptocurrency!

XMR-STAK API and Agent Issue

I have encountered an error while mining Alloy with the XMR-STAK_Alloy 2.4.5 miner in HiveOS [email protected] It looks like the agent cannot read the correct hashrate from the miner jason.api. After doing some digging this is the out put that I get from the jason.api.

{"version":"xmr-stak-alloy/2.4.5/0000000/unknown/lin/nvidia-amd-cpu/alloy/0","hashrate":{"threads":[[null,446.3,null],[null,446.4,null],[null,446.1,null],[null,446.5,null],[null,446.1,null],[null,446.5,null]],"total":[null,2677.9,null],"highest":0.0},"results":{"diff_current":66581,"shares_good":744,"shares_total":744,"avg_time":0.9,"hashes_total":1979451,"best":[306571,284566,280957,247750,195412,182051,173105,169722,167850,130559],"error_log":[]},"connection":{"pool": "stratum+tcp://","uptime":685,"ping":117,"error_log":[]}}

After looking at how the agent pulls miner stats, I found these two lines to be problematic in the script under /hive/miner/xmr-stak.

line 24
khs=`echo $stats_raw | jq -r '[0]' | awk '{print $1/1000}'`

line 52
'{ver: $ver, hs: [.hashrate.threads[][0]], $algo, $temp, $fan, $cpu_temp, uptime: .connection.uptime, ar: [$ac, $rj]}' <$

The[0] and .hashrate.threads[0] is set to monitor the 10 second hashrate report column. For whatever reason, this populates with a null value. This is likely an issue with the miner, but as a result it causes hive to believe the miner is not hashing.

There is a quick fix to this. Change the [0] locator to [1] and you will start seeing values populated. This is a hack of the script and should not be used unless you know what you are doing.

For the Hive devs, I would recommend adding a If loop to these sections, checking for a null value. If there is a null value in position 0, try postion 1 and then try position 2. Just my 2 cents.

Hope this helps someone.