pacemaker plugin
Needs test-tools!220 (merged)
It is a basic substitute for not yet implemented mock-peer
tool. The plugin can only pull blocks from separate block log and pass them to node as if they arrived from p2p. Works only in testnet and only when there is just one pacemaker
and no witness
plugin in whole network.
Draft: only very basic tests were run with it, so it should be treated as experiment.
How to use:
- you need separate
block_log
file and associatedblock_log.artifacts
to act as a source of blocks - add
plugin = pacemaker
toconfig.ini
and make sure there is nowitness
- add
pacemaker-source = <SOURCE_BLOCK_LOG_PATH>
pointing to above mentionedblock_log
- you can also add
pacemaker-min-offset = <OFFSET_FROM_BLOCK_TS>
- pacemaker will wait untilblock.timestamp + min_offset
before emitting the block; default value is-300
meaning blocks can be emitted up to -300ms before their timestamp (which is typical value for healthy network) but you can emulate lagging node by setting the value to some big positive number - you can add
pacemaker-max-offset = <OFFSET_FROM_BLOCK_TS>
- pacemaker will stop the node in case it didn't manage to emit the block beforeblock.timestamp + max_offset
indicating either wrong starting time (when it happens on startup) or too big processing lag (when it happens later); default value is20000
which is 20 seconds - you have to run the node with
faketime
setting time prior tofirst_block_to_emit.timestamp + max_offset
; if time is too early, the node will idly wait until the time is right (see log message:First block to emit is #<BLOCK_NUM> with timestamp <BLOCK_TS>; Current time: <TIME>
); for this reason it is better to be a bit late (but not too much or the node will fail on startup), becausepacemaker
will try to catch up by emitting blocks at max processing speed (emulating "sync mode")
Edited by Andrzej Lisak