The indexer tracks three main types of blockchain events:
Transaction Events (transaction_events
table)
- Records events emitted during transaction execution
- Fields:
transaction_hash
- Hash of the transactionblock_height
- Block height where the event occurredevent_key
- Event type and attribute key (format: "event_type.attribute_key")event_value
- Value associated with the eventevent_index
- Order of the event within the transaction
Block Events (finalize_block_events
table)
- Captures events that occur during block finalization
- Fields:
block_height
- Height of the blockevent_key
- Event type and attribute keyevent_value
- Value associated with the eventevent_index
- Order of the event within the blockmode
- Either "BeginBlock" or "EndBlock" indicating when the event occurred
Move Events (move_events
table)
- Tracks events from Move smart contract execution
- Fields:
type_tag
- Move event type identifierdata
- Event payload in JSON formatblock_height
- Block height where the event occurredtransaction_hash
- Hash of the transaction that emitted the eventevent_index
- Order of the event within the transaction
Sweeper - Polls the RPC for new block data and submits it to the message queue.
Flusher - Consumes messages from the queue and processes them into the database.
Prunner - Periodically prunes the database and stores backups in a cloud storage service.
Each service runs continuously and must be executed together for the indexer to function properly.
Sweeper
- Retrieves the latest indexed block from the database.
- Fetches data for the next block using the RPC methods
/block
and/block_results
. - Publishes the block data as a message to the message queue.
Flusher
- Subscribes to and reads messages from the queue.
- Processes each message and inserts the data into the database.
Prunner
- Triggers at predefined intervals.
- Checks whether the database requires pruning.
- If pruning is needed:
- Fetches prunable rows from the database.
- Uploads the data to a cloud storage service.
- Deletes the fetched rows from the database.
To run the Informative Indexer with Docker locally, follow this guide.