最後更新: 2021-02-11
目錄
ethminer api
# Use 0 to disable. Default=0
# use negative numbers to run in readonly mode. for example -3333.
--api-port <portnum>
Messages exchanged through this channel must conform the Jsonrpc v.2 specifications
miner_ping
echo '{"id":0,"jsonrpc":"2.0","method":"miner_ping"}' | netcat 127.0.0.1 3333
miner_getstat1
A collection of statistical data (miner_getstat1)
echo '{"id": 1,"jsonrpc": "2.0","method": "miner_getstat1"}' | netcat 127.0.0.1 3333 | jq
{ "id":1, "jsonrpc":"2.0", "result":[ "0.16.0.dev0+commit.41639944", // The actual release of ethminer "48", // Total running time in minutes "87221;54;0", // ETH hashrate in KH/s, submitted shares, rejected shares "14683;14508;14508;14508;14508;14508", // Detailed ETH hashrate in KH/s per GPU "0;0;0", // (not used) DCR hashrate in KH/s, submitted shares, rejected shares "off;off;off;off;off;off", // (not used) Detailed DCR hashrate in KH/s per GPU "53;90;50;90;56;90;58;90;61;90;60;90", // Temp and fan speed pairs per GPU "eu1.ethermine.org:4444", // Mining pool currently active "0;0;0;0" // ETH invalid shares, ETH pool switches, DCR invalid shares, DCR pool switches ] }
miner_shuffle
The mining process is nothing more that finding the right number(nonce) which,
applied to an algorithm (ethash) and some data,
gives a result which is below or equal to a given target.
This process in very very (very) short !
The range of nonces to be searched is a huge number:
2^64 = 18446744073709600000 ~ possible values.
Each one has the same probability to be the right one.
Every time ethminer receives a job from a pool
you'd expect the miner to begin searching from the first but that would be boring.
So the concept of scramble nonce has been introduced to achieve these goals:
* Start the searching from a random point within the range
* Ensure all GPUs do not search the same data(without overlapping)
"miner_shuffle" method does is to re-initialize a new random scramble nonce to start from in next jobs.
{"id": 1, "jsonrpc": "2.0", "method": "miner_shuffle"}
miner_restart
useful if you detect one, or more, GPU are in error but in a recoverable state
recoverable state = no hashrate but the GPU has not fallen off the bus
原理: restart ethminer without loosing connection to the pool )
過程
- Stop actual mining work
- Unload generated DAG files
- Reset devices (GPU)
- Regenerate DAG files
- Restart mining
echo '{"id": 1, "jsonrpc": "2.0", "method": "miner_restart"}' | netcat 127.0.0.1 3333