miner
The miner namespace provides RPC endpoints for controlling the mining operations on your R5 node. These endpoints allow you to start and stop the mining process, adjust mining parameters such as extra data and gas price, and monitor the current mining hashrate. They are essential for managing and optimising the node’s mining performance.
miner_getHashrate
Description: Returns the current mining hashrate of the node as a hexadecimal string, representing the number of hashes computed per second.
Sample Request:
Expected Response:
Parameters: None.
miner_setEtherbase
Description: Sets the Etherbase (coinbase) address for the miner. This address will receive the mining rewards.
Sample Request:
Expected Response:
Parameters:
address (string): The hexadecimal address to set as the Etherbase. &#xNAN;Example:
"0x288be778b666ed006357ce12f455fbb3c7d0ec94"
.
miner_setExtra
Description: Sets the extra data field that will be included in mined block headers. This field can be used to include custom data or miner identification.
Sample Request:
Expected Response:
Parameters:
extra (string): A hexadecimal string representing the extra data to be embedded in block headers. &#xNAN;Example:
"0x5265565734"
.
miner_setGasLimit
Description: Sets the gas limit that will be used when mining new blocks. This parameter can control the maximum gas per block that the miner is willing to include.
Sample Request:
Expected Response:
Parameters:
gasLimit (string): The gas limit for mining blocks, represented as a hexadecimal string. &#xNAN;Example:
"0x7a1200"
.
miner_setGasPrice
Description: Sets the gas price (in wei) that the miner will use for including transactions in blocks.
Sample Request:
Expected Response:
Parameters:
gasPrice (string): The gas price in wei, represented as a hexadecimal string. &#xNAN;Example:
"0x4a817c800"
(which is 20 Gwei).
miner_setRecommitInterval
Description: Sets the interval (in seconds or blocks, as defined by the implementation) at which the miner recommits work. This can be used to adjust how frequently the mining work is updated.
Sample Request:
Expected Response:
Parameters:
interval (number): The recommit interval value. The unit (seconds or blocks) depends on the node configuration. &#xNAN;Example:
10
.
miner_start
Description: Starts the mining process on the node using the configured parameters. The node will begin performing proof-of-work calculations to mine new blocks.
Sample Request:
Expected Response:
Parameters:
threads (number): The number of mining threads (workers) to run. &#xNAN;Example:
2
.
miner_stop
Description: Stops the mining process on the node, halting proof-of-work calculations and block production.
Sample Request:
Expected Response:
Parameters: None.
Last updated