Skip to content

Commit

Permalink
Move INDEXER_BLOCK_CONFIRMATIONS to config
Browse files Browse the repository at this point in the history
  • Loading branch information
AllFi committed Jun 6, 2024
1 parent f29dbb2 commit bf9b678
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions zp-relayer/configs/indexerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const schema = z.object({
INDEXER_STATE_DIR_PATH: z.string().default('./INDEXER_STATE'),
INDEXER_TX_VK_PATH: z.string().default('../params/transfer_verification_key.json'),
INDEXER_TOKEN_ADDRESS: z.string(),
INDEXER_BLOCK_CONFIRMATIONS: z.coerce.number().default(1),
})

const config = schema.parse(process.env)
Expand Down
2 changes: 1 addition & 1 deletion zp-relayer/services/indexer/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function init() {
const startBlock = lastInitialSyncBlock + 1
const watcher = new Watcher(networkBackend, networkBackend.pool, 'pool-indexer', {
event: 'allEvents',
blockConfirmations: parseInt(process.env.INDEXER_BLOCK_CONFIRMATIONS || '1'),
blockConfirmations: config.INDEXER_BLOCK_CONFIRMATIONS,
startBlock,
eventPollingInterval: parseInt(process.env.WATCHER_EVENT_POLLING_INTERVAL || '10000'),
batchSize: config.base.COMMON_EVENTS_PROCESSING_BATCH_SIZE,
Expand Down

0 comments on commit bf9b678

Please sign in to comment.