Skip to content

Commit

Permalink
watcher/scripts: reduce near batchsize
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel committed Sep 7, 2023
1 parent e87452a commit 988b630
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion watcher/scripts/backfillNear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getMessagesFromBlockResults } from '../src/watchers/NearWatcher';
// Ensure `DB_SOURCE` and Bigtable environment variables are set to backfill Bigtable database.
// Otherwise, the script will backfill the local JSON database.

const BATCH_SIZE = 1000;
const BATCH_SIZE = 100;

(async () => {
const db = initDb();
Expand All @@ -25,10 +25,12 @@ const BATCH_SIZE = 1000;
const fromBlock = Number(
(await db.getLastBlockByChain(chain)) ?? INITIAL_DEPLOYMENT_BLOCK_BY_CHAIN[chain] ?? 0
);
// console.log(`Last block seen: ${fromBlock}`);

// fetch all transactions for core bridge contract from explorer
let log = ora('Fetching transactions from NEAR Explorer...').start();
const toBlock = await provider.block({ finality: 'final' });
// console.log('\ntoBlock', toBlock.header.height, toBlock.header.timestamp.toString());
const transactions = await getTransactionsByAccountId(
CONTRACTS.MAINNET.near.core,
BATCH_SIZE,
Expand Down

0 comments on commit 988b630

Please sign in to comment.