Introduction
Due to iterative development, we have to trigger re-indexing almost every weeks. Our code is linked to Kafka and that means that each re-indexing will spam our Kafka with "useless" messages, in the sense that they are historical and not interesting for live listening to events.
Proposed solution
Would be the great to be able to know from the event params in the handlers if the event comes from historical or live indexation.
Here is a sample of what it would look like:
UniswapV4Pool.Swap.handler(async ({ event, context }) => {
const poolState = await getV4PoolState(event.srcAddress as Address);
if(!poolState){
return;
}
await insertOrUpdateV4Pool(context, event.srcAddress as Address, poolState, { eventBlockNumber: event.block.number, eventBlockTimestamp: event.block.timestamp });
if(event.origin == EventOrigin.Live){
broadcastToKafka(event);
}
});
Introduction
Due to iterative development, we have to trigger re-indexing almost every weeks. Our code is linked to Kafka and that means that each re-indexing will spam our Kafka with "useless" messages, in the sense that they are historical and not interesting for live listening to events.
Proposed solution
Would be the great to be able to know from the event params in the handlers if the event comes from historical or live indexation.
Here is a sample of what it would look like: