Getting Started
The Indexer
Inside the app/indexer/main.ts
you can register your hooks (the filters).
So something like that, allows you to scan each and every blocks searching for the specified wallet addresses.
The other available option is the PolicyId
, the filters are defined here : src/core/filters
In summary, each block will go through each filters and once there is a match the block is sent to Kafka with the matches information.
The indexer also supports a local queue, so you can set the amount of block_to_wait
, this value checks if the queued block height
is higher than the tip height + block_to_wait
value, if so it publishes it to the Kafka queue. This way it limits the potential of having to delete messages from the database or any other system you have. But it reduces the real-time effect of your system. For my tests I set the block_to_wait
to 6.
Starting from genesis, keep in mind that everytime the indexer is started from the genesis, it will trigger a rollback event, thus deleting everything newer than the genesis itself.
The Processor
This instance get each block in a sequential manners. this way the order of each block is kept.
You can customize your kafka handling to fit your needs.
Then when a block is received, the processor will go through each handlers and apply what you need with the block data.
To create or edit existing handlers, update code available here : app/processor/handlers
The retry and rollback handling can be easily updated to fit your needs as well.
Currently the rollback is simply deleting all the recent blocks compared to the received tip and continue from the new tip received from the chain. When you handle your data for your application, keep in mind that the chain can rollback.
Last updated
Was this helpful?