Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds transaction backfill for Blocks mode. #159

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ createConnection(ormConfig as ConnectionOptions)
if (SCRAPER_MODE === 'BLOCKS') {
schedule(connection, producer, blockEventsScraper.getParseSaveAsync, 'Pull and Save Blocks and Events');
schedule(connection, producer, blockEventsScraper.backfillAsync, 'Backfill Blocks and Events');
schedule(
connection,
producer,
backfillTxScraper.getParseSaveTxBackfillAsync,
'Pull and Save Backfill Transactions',
);
schedule(connection, producer, eventsBackfillScraper.getParseSaveEventsAsync, 'Backfill Events by Topic');
} else if (SCRAPER_MODE === 'EVENTS') {
schedule(null, null, currentBlockMonitor.monitor, 'Current Block');
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/pull_and_save_block_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export class BlockEventsScraper {

const oldestBlocksToBackfill = await connection.query(
`SELECT DISTINCT block_number
FROM ${SCHEMA}.tx_backfill
FROM ${SCHEMA}.block_backfill
WHERE done = false
ORDER BY block_number
LIMIT ${MAX_BLOCKS_TO_PULL}`,
Expand All @@ -379,7 +379,7 @@ export class BlockEventsScraper {
const queryRunner = connection.createQueryRunner();
await queryRunner.connect();
await queryRunner.manager.query(
`UPDATE ${SCHEMA}.tx_backfill
`UPDATE ${SCHEMA}.block_backfill
SET done = true
WHERE block_number IN (${newBlockNumbers.join(',')})`,
);
Expand Down
Loading