demo.mp4

- The indexer listens to events mentioned in the filter.
- Indexer will be pushing all the events for the filter to the message queue.
- Message Queue is being used as a mediator between the listener and logger to ensure all events get properly logged. A fire-and-forget style would leave us vulnerable to missing out on events.
- There's a
transform
function inside the/consumer
directory. This function will perform some transformation (or keep it as is) before putting the event object on the database.
docker compose up -d
to start the queue and the database.- In one terminal, add the following env variables in an env file in the
indexer
directory.
RPC_URL_WS=<WEBSOCKET_RPC_URL>
RPC_URL_HTTP=<HTTP_RPC_URL>
DATABASE_URL=MONGODB_CONNECTION_STRING
- Start the indexer wth the command
cargo run
- Head to
/consumer
and start the consumer withnpm run start
(npm install
first to get the dependencies)