Skip to content

Commit

Permalink
feat(hapi): add env variable to disable missed blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Jun 20, 2023
1 parent 4a8887b commit 4ab8ce0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions hapi/src/config/eos.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module.exports = {
: '',
stateHistoryPluginEndpoint:
process.env.HAPI_EOS_STATE_HISTORY_PLUGIN_ENDPOINT,
missedBlocksServiceEnabled:
Boolean(process.env.HAPI_EOS_MISSED_BLOCKS_ENABLED) || false,
keepBlockHistoryForDays:
parseInt(process.env.HAPI_EOS_BLOCK_HISTORY_DAYS) || 0,
chainId: process.env.HAPI_EOS_API_CHAIN_ID,
Expand Down
8 changes: 6 additions & 2 deletions hapi/src/workers/producers.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ const start = async () => {
if (eosConfig.stateHistoryPluginEndpoint) {
run('BLOCK HISTORY CLEANUP', stateHistoryPluginService.cleanOldBlocks, 43200)
run('SYNC BLOCK HISTORY', stateHistoryPluginService.init)
run('SYNC MISSED BLOCKS', missedBlocksService.syncMissedBlocks)
run('SYNC MISSED BLOCKS PER PRODUCER', statsService.getCurrentMissedBlock)

if (eosConfig.missedBlocksServiceEnabled) {
run('SYNC MISSED BLOCKS', missedBlocksService.syncMissedBlocks)
run('SYNC MISSED BLOCKS PER PRODUCER', statsService.getCurrentMissedBlock)
}

run('SYNC SCHEDULE HISTORY', demuxService.init)
run('SYNC TPS', statsService.syncTPSAllTimeHigh)
run(
Expand Down

0 comments on commit 4ab8ce0

Please sign in to comment.