Skip to content

new_block event integration

Compare
Choose a tag to compare
@JeffWScott JeffWScott released this 25 Jan 14:39
· 186 commits to main since this release

Changes

  1. New blocks are captured from the masternode new_block websocket events
  2. Previous blocks are still captured by calling the masternode block endpoint which means syncing from block 0 will still take a while and cause a draw on the masternode. A quicker block syncing mechanism is needed (ie, syncing a block service from an existing block service)
  3. Block service will now attempt to repair missing blocks every 5 minutes on the previous 1000 blocks. These are blocks that for whatever reason the node couldn't get the information for when it tried.

Upgrade Steps from <= v0.6.3:

  1. pull latest code from master
  2. npm install
    • to install some added packages
  3. run the "setRepairHeight" loader
    • from the project root run node src/database/loaders/setRepairHeight.mjs <block_num> where <block_num> is your last synced block. You can get this from the /synced_stats endpoint
    • If you don't do this then it will start to reprocess/sync from block 0. It will check that the block exists in the DB before pulling it from the masternode. If the block in the DB is designated as "block-does-not-exist" it will get the block information from the masternode and then process that block. As it does this it sets "repairHeight" to the last block synced. So setting this manually via the loaders script will avoid the delay.
  4. restart block service instance