Set Block Selection Algorithm

Status

Modifies the running DLT Node or Miner software and changes the way blocks are selected for mining. It is also possible to activate or deactivate mining using this method.

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: setBlockSelectionAlgorithm

Input parameters:

ParameterTypeRequiredDescription
algorithmNumberYesNew block selection algorithm. See the values above.

Errors:

ErrorDescription
RPC_INTERNAL_ERRORAn unknown error occurred in the node. Please check the node log for details.

Output:

  • success: JSON result with all null values
  • fail: JSON encoded details with a non-null error and a null result

Example:

GET http://localhost:8081/setBlockSelectionAlgorithm?algorithm=1

{
	"result": null,
	"error": null,
	"id": null
}