Get Mining Block

Get Mining Block

Requests a block to begin working on a PoW solution. This method is primarily meant to support mining pool operation, so that miners do not need to function as DLT nodes and can simply request work units from the pool controller or another designated DLT Node.

The function only returns the relevant block data required for computing the PoW solution.

Note: In a cooperative pool mining, the solution should incorporate the pool controller's wallet address, so that it can be successfully verified by the DLT network. The pool controller is responsible for further reward payouts based on miner participation or any other metric at the pool's discretion.

Algorithms

IDNameDescription
-1No algorithmStop mining.
0lowestDifficultyPick the block with the lowest difficulty value.
1randomLowestDifficultySort blocks from easiest to hardest and pick a random block within the easiest 500 blocks.
2latestBlockPick the most recent accepted block.
3randomPick a random block.

Method: getminingblock

Input parameters:

ParameterTypeRequiredDescription
algoNumberYesID of the desired mining algorithm

Errors:

ErrorDescription
RPC_INVALID_PARAMETERThe required parameter is missing.
RPC_INTERNAL_ERRORAn unknown error occurred in the node. Please check the node log for details.

Output:

  • success: Data required to compute PoW soltuion for the block.
  • fail: JSON encoded error details and the result field set to null

Example:

GET http://localhost:8081/getminingblock?algo=1

{
  "result": {
    "num": 233456,
    "ver": 4,
    "dif": 11730489520294945000,
    "chk": "vq00ZxZ...QYMCaRmn7GAMhHx4=",
    "adr": "AVB+ikpJqpX6K+dZriTTbuQ/Tt6Eh4oQ3pKpelESHnGD1T0769Sm/ERgb0kCZoNo"
  },
  "error": null,
  "id": null
}