regen-ledger icon indicating copy to clipboard operation
regen-ledger copied to clipboard

Specification for Postgres Indexer

Open clevinson opened this issue 5 years ago • 1 comments

For indexing ORM Modules in Cosmos SDK to postgres.

Maybe get architectural review from Ethan.

clevinson avatar Feb 25 '20 15:02 clevinson

For a proof of concept Postgres indexer, I propose we start with some proof of concept credit metadata as outlined in #178.

Then we could either poll tendermint for new blocks or use websockets to listen for specific events, see: https://docs.tendermint.com/master/rpc/

The basic way I see this working is:

  1. we receive an event, ex. EventCreateBatch
  2. run the corresponding query to get all the data, ex. Query/BatchInfo
  3. INSERT or UPDATE corresponding tables in postgres, ex. batch_info. In postgres, however, maybe the batch_info table could also have columns for polygon and dates as specified in #178 when those can be parsed from metadata

I don't think this is necessarily a substitute for listening at the store level as Ian is working on, but I think it can work for now.

What do you think @robert-zaremba ?

aaronc avatar Nov 18 '20 21:11 aaronc