0

I'm running monerod as service, mining with 3 threads. How can I get the hashrate info?

monerod status fails to connect:

$ monerod status                                                                            
Error: Couldn't connect to daemon: 127.0.0.1:18081
Height: 1480810/1480810 (100.0%) on mainnet, mining info unavailable, net hash 644.80 MH/s, v6, up to date, 9(out)+36(in) connections, uptime 1d 1h 47m 55s
$ netstat -nap | grep 18081                                                                 
tcp        0      0 0.0.0.0:18081           0.0.0.0:*               LISTEN      -    

The port is open (telnet 127.0.0.1 18081 connects properly).

edit: I noticed the restricted-rpc option blocks mining info from being accessed. The node is public and I need to keep that option. So, the question is how can I check hashrate in such setup?

1 Answer 1

1

You probably started monerod with --restricted-rpc. This will deny access to the mining information, as it is private (ie, none of any third party's business).

You can now start a daemon with two RPC ports, one with restricted RPC (presumably exposed to the internet) and one not. See this in monerod --help:

--rpc-bind-port arg (=18081) Port for RPC server --rpc-restricted-bind-port arg Port for restricted RPC server

Another way is to ask the JSON RPC directly: curl -v -X POST http://127.0.0.1:18081/mining_status -d '{}' -H 'Content-Type: application/json'

You then get the hash rate in the speed field.

2
  • I'm using v0.11.1.0-release and it seems to lack the --rpc-restricted-bind-port option. I see it's present in the last source from master. Can I still get that info from official release?
    – emesik
    Commented Jan 5, 2018 at 23:47
  • It was added since that release. You could find the patch and cherry-pick it onto the release branch if you wanted.
    – user36303
    Commented Jan 6, 2018 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.