bryanlabs/cosmos-indexer-sdk

Implement Block Event model indexing

Closed this issue · 1 comments

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:

  1. BlockEvent model
  2. Key column
  3. Value column

The best index will most likely be on the Key column.

The above description was slightly incorrect due to some mistypes. The new models are:

  1. BlockEvent - A model to store the main event emission
  2. BlockEventType - Holds unique indexed block event types to reduce database size with these (usually) unique keys
  3. BlockEventAttribute - Holds attributes linked to BlockEvents with a BelongsTo relation
  4. BlockEventAttributeKey - Holds unique indexed block event attribute keys to reduce database size with these (usually) unique keys