Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.25 KB

dlt_set_block_selection_algorithm.md

File metadata and controls

45 lines (35 loc) · 1.25 KB
title type
Set Block Selection Algorithm
dlt

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

ID Name Description
-1 No algorithm Stop mining.
0 lowestDifficulty Pick the block with the lowest difficulty value.
1 randomLowestDifficulty Sort blocks from easiest to hardest and pick a random block within the easiest 500 blocks.
2 latestBlock Pick the most recent accepted block.
3 random Pick a random block.

Method: setBlockSelectionAlgorithm

Input parameters:

Parameter Type Required Description
algorithm Number Yes New block selection algorithm. See the values above.

Errors:

Error Description
RPC_INTERNAL_ERROR An 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
}