Implement Block Event model indexing
Closed this issue · 1 comments
pharr117 commented
Each block can contain Begin Blocker and End Blocker events. See here for what they are used for.
We need to implement a model that will be used for indexing begin block and end block events.
Events in the begin block and end block sections of the block data are typical Cosmos (Tendermint) K/V pairs. See here for how they work.
We will want to store the values in the Block Events in the following way:
- BlockEvent model
- Key column
- Value column
The best index will most likely be on the Key column.
pharr117 commented
The above description was slightly incorrect due to some mistypes. The new models are:
- BlockEvent - A model to store the main event emission
- BlockEventType - Holds unique indexed block event types to reduce database size with these (usually) unique keys
- BlockEventAttribute - Holds attributes linked to BlockEvents with a BelongsTo relation
- BlockEventAttributeKey - Holds unique indexed block event attribute keys to reduce database size with these (usually) unique keys