Installation and usage of the platform

General platform configuration: mining

The blockchain mining parameters are set in the miner section of the node configuration file:

miner {
  enable = yes
  quorum = 2
  interval-after-last-block-then-generation-is-allowed = 10d
  no-quorum-mining-delay = 5s
  micro-block-interval = 5s
  min-micro-block-age = 3s
  max-transactions-in-micro-block = 500
  max-block-size-in-bytes = 1048576
  min-micro-block-age = 6 s
  minimal-block-generation-offset = 200ms
  pullin-buffer-size = 100
  utx-check-delay = 1s
  • enable – activation of the mining option. Enable – yes, disable – no.

  • quorum – required number of miner nodes to create a block. A value of 0 will generate blocks offline and is used only for test purposes in networks with one node. When specifying this value, take into account that your own miner node does not sum up with the value of this parameter, i.e. if you specify quorum = 2, then you need at least 3 miner nodes for mining.

  • interval-after-last-block-then-generation-is-allowed – enable block generation only if the last block is not older than the specified time period (in days).

  • micro-block-interval – an interval between microblocks (in seconds).

  • min-micro-block-age – the minimum age of the microblock (in seconds).

  • max-transactions-in-micro-block – the maximum number of transactions in the microblock.

  • minimal-block-generation-offset – the minimum time interval between blocks (in milliseconds).

  • pulling-buffer-size – size of transactions buffer. The higher the value of the parameter, the longer the transactions group.

  • utx-check-delay – UTX pool inspection delay. The miner periodically inspects the pool to make sure if it is empty or not. 1 s is used as the default value. The parameter value must be equal to or more than 100 ms.

The mining settings depend on the planned size of transactions on your network.

Mining settings and consensus algorithm

Also, blockchain mining is closely related to the chosen consensus algorithm. The following parameters of the miner section must be taken into account when configuring the consensus parameters:

  • micro-block-interval – an interval between microblocks (in seconds).

  • min-micro-block-age – the minimum age of a microblock. The value is specified in seconds and must not exceed the value of micro-block-interval.

  • minimal-block-generation-offset – a minimal time interval between blocks (in milliseconds).

The values of microblock creation parameters must not exceed or otherwise conflict with the values of average-block-delay for PoS and round-duration for PoA and CFT. The number of microblocks in a block is not limited but depends on the size of the transactions included in the microblock.

UTX settings

The unconfirmed transactions pool (UTX) has a rebroadcasting mechanism, which allows the network to recover faster if any failures occur – for example, if network connectivity between nodes is lost. In such cases, transactions sent to a single node may not be broadcasted. The rebroadcasting mechanism solves such problems by periodically checking the relevance of the transactions in a node UTX.

This mechanism checks all the transactions in the UTX once in a period of time set in the interval parameter; it then resends to its peers those transaction whose creation date differs from the current date by more than the period set in the threshold parameter.

The UTX parameters are set in the utx section of the node configuration file:

utx {
  • memory-limit – the maximum UTX pool size; when calculating the UTX pool size, only the serialized form, not the total size of transactions in memory, is taken into account;

  • rebroadcast-threshold – after the transaction is created, when the time period specified in the parameter elapses, the transaction is considered “old” and must be rebroadcast; the default value of the parameter is 5m;

  • rebroadcast-interval – task interval for re-broadcasting the “old” transactions; the default value of the parameter is 5m.

See also