diff --git a/scripts/load-from-source.js b/scripts/load-from-source.js index 188fabc..ae185c3 100644 --- a/scripts/load-from-source.js +++ b/scripts/load-from-source.js @@ -84,17 +84,17 @@ async function processBlockReceipts(streamerMessage, { include, exclude }) { async function loadStream(options) { const { startBlockHeight, - bucketName, - regionName, - endpoint, batchSize, limit, + updateBlockHeight, include, exclude, - updateBlockHeight, source, + ...otherOptions } = options; + console.log('otherOptions', otherOptions); + const { readBlocks } = require(`fast-near/source/${source}`); const defaultStartBlockHeight = parseInt(process.env.NEARFS_DEFAULT_START_BLOCK_HEIGHT || '0'); @@ -104,16 +104,16 @@ async function loadStream(options) { for await (let streamerMessage of readBlocks({ startBlockHeight: start, - s3BucketName: bucketName || "near-lake-data-mainnet", - s3RegionName: regionName || "eu-central-1", - s3Endpoint: endpoint, + endBlockHeight: limit ? start + limit : undefined, + batchSize, + ...otherOptions })) { await withTimeCounter('handleStreamerMessage', async () => { await handleStreamerMessage(streamerMessage, { batchSize, + updateBlockHeight, include, exclude, - updateBlockHeight, }); });