Stephan pfp
Stephan
@stephancill
what is the best way to index data in real time based on tx calldata suffix? /ponder-sh doesn't have this functionality out of the box cc @horsefacts.eth in case you guys are indexing frame txs for whatever reason (also can i get an invite to /evm pls)
3 replies
0 recast
6 reactions

Kevin pfp
Kevin
@typedarray.eth
Just saw this - answering for posterity! Ponder approach: 1) Add "account" with "address: undefined" (match all addresses) 2) Register indexing fn for "transaction:from" event 3) if (!event.tx.input.endsWith("...")) return If you need logs/traces created by the matched tx, can use an RPC request in your indexing function. Historical backfill also doable, though you'll have to fetch every block. The core issue is that the RPC API does not support tx input filters. To do any better than "fetch all txs and filter client-side" you need a pre-indexed database of the entire chain, like the indexsupply approach or something custom. Docs: https://ponder.sh/docs/accounts#register-indexing-functions
2 replies
0 recast
3 reactions

Brock pfp
Brock
@runninyeti.eth
tl;dr - distributed JavaScript functions 😉 e.g. here's an quick start for decoding Uniswap logs: https://indexing-co.notion.site/Uniswap-Quickstart-19025f03105380c681cbd307845123de Instead of the for loop checking logs, you could literally write: `if (tx.input.startsWith('prefix')) { ... }` And then have all of that be send to your db, webhook, queue, etc
1 reply
0 recast
4 reactions

Garrett pfp
Garrett
@garrett
@indexsupply
1 reply
0 recast
1 reaction