diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 12:04:08 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 12:04:08 +0800 |
commit | 00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe (patch) | |
tree | e2e1c5394deac225bf493b3fe51da9f3074f1691 /packages/pipeline/src/scripts/pull_missing_blocks.ts | |
parent | 549f5e4655f246062dd6451065ec01eb789dbd8f (diff) | |
download | dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.gz dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.bz2 dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.lz dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.xz dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.tar.zst dexon-sol-tools-00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe.zip |
Address PR feedback
Diffstat (limited to 'packages/pipeline/src/scripts/pull_missing_blocks.ts')
-rw-r--r-- | packages/pipeline/src/scripts/pull_missing_blocks.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/packages/pipeline/src/scripts/pull_missing_blocks.ts b/packages/pipeline/src/scripts/pull_missing_blocks.ts index 4a1483ab9..b7bd51f08 100644 --- a/packages/pipeline/src/scripts/pull_missing_blocks.ts +++ b/packages/pipeline/src/scripts/pull_missing_blocks.ts @@ -9,7 +9,7 @@ import { Web3Source } from '../data_sources/web3'; import { Block } from '../entities'; import * as ormConfig from '../ormconfig'; import { parseBlock } from '../parsers/web3'; -import { handleError } from '../utils'; +import { EXCHANGE_START_BLOCK, handleError, INFURA_ROOT_URL } from '../utils'; // Number of blocks to save at once. const BATCH_SAVE_SIZE = 1000; @@ -18,16 +18,13 @@ const MAX_CONCURRENCY = 10; // Maximum number of blocks to query for at once. This is also the maximum // number of blocks we will hold in memory prior to being saved to the database. const MAX_BLOCKS_PER_QUERY = 1000; -// Block number when the Exchange contract was deployed to mainnet. -// TODO(albrow): De-dupe this constant. -const EXCHANGE_START_BLOCK = 6271590; let connection: Connection; (async () => { connection = await createConnection(ormConfig as ConnectionOptions); const provider = web3Factory.getRpcProvider({ - rpcUrl: `https://mainnet.infura.io/${process.env.INFURA_API_KEY}`, + rpcUrl: `${INFURA_ROOT_URL}/${process.env.INFURA_API_KEY}`, }); const web3Source = new Web3Source(provider); await getAllMissingBlocks(web3Source); |