Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Nov 1, 2024
1 parent f413d5c commit fbd3147
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 2 additions & 3 deletions test/erc20-transfers/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ const CONTRACT = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'.toLowerCase()

const processor = new EvmBatchProcessor()
.setPortal({
url: 'https://portal.sqd.dev/datasets/ethereum-mainnet',
url: 'http://localhost:8000/datasets/ethereum-mainnet',
bufferThreshold: 100 * 1024 * 1024
})
// .setRpcEndpoint(process.env.ARB_NODE_WS)
.setRpcEndpoint('https://rpc.ankr.com/eth')
.setFinalityConfirmation(500)
.setBlockRange({from: 0})
.setFields({
Expand All @@ -28,7 +28,6 @@ const processor = new EvmBatchProcessor()
processor.run(new TypeormDatabase({supportHotBlocks: true}), async ctx => {
let transfers: Transfer[] = []


for (let block of ctx.blocks) {
for (let log of block.logs) {
if (log.address == CONTRACT && erc20.events.Transfer.is(log)) {
Expand Down
11 changes: 3 additions & 8 deletions util/util-internal-ingest-tools/src/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ export function archiveIngest<B extends Block>(args: ArchiveIngestOptions): Asyn
let beg = req.range.from
let end = req.range.to ?? Infinity
if (client.stream) {
if (top < beg) {
top = await height.get()
}
if (top < beg && stopOnHead) return

for await (let blocks of client.stream<B>({
Expand All @@ -63,16 +60,14 @@ export function archiveIngest<B extends Block>(args: ArchiveIngestOptions): Asyn
let lastBlock = last(blocks).header.number
assert(lastBlock >= beg)
beg = lastBlock + 1

if (top < beg) {
top = await height.get()
}


yield {
blocks,
isHead: beg > top
}

top = await height.get()

if (top < beg && stopOnHead) return
}
} else {
Expand Down

0 comments on commit fbd3147

Please sign in to comment.