regen-ledger
regen-ledger copied to clipboard
Add ability to query all events on a per module basis
Summary
The Regen Registry interface has a page that lists all events emitted by the ecocredit module and the implementation requires adding each event type. It's possible to query all events per module in the sdk and should be possible within regen-ledger.
Problem Definition
A user should be able to query all events on a per module basis.
Proposal
Add ability to query all events on a per module basis. Needs further investigation.
For Admin Use
- [ ] Not duplicate issue
- [ ] Appropriate labels applied
- [ ] Appropriate contributors tagged
- [ ] Contributor assigned/self-assigned
For reference:
// TODO: until ledger API supports "message.module='ecocredit'",
// we must send separate requests for each message action type:
https://github.com/regen-network/regen-web/blob/master/web-registry/src/lib/ecocredit.ts#L100-L101
It looks like the following only works with legacy events and not typed events:
regen q txs --events message.modules='ecocredit'
It is possible to query all events but not per module:
regen q txs --events message.action=''
For reference, to query a single event /
should not be included after Msg
:
No results using the format specified in the sdk documentation:
regen q txs --events message.action='/regen.ecocredit.v1.Msg/CreateClass'
Expected results provided without /
after Msg
:
regen q txs --events message.action='/regen.ecocredit.v1.MsgCreateClass'
We should try the postgres indexer: https://docs.tendermint.com/master/app-dev/indexing-transactions.html
Removing this as nice to have for v4.0 and moving this to the backlog. Querying for all events per module is currently not possible with typed events and experimenting with the postgres indexer seems like more work than necessary for v4.0.
Removing this as nice to have for v4.0 and moving this to the backlog. Querying for all events per module is currently not possible with typed events and experimenting with the postgres indexer seems like more work than necessary for v4.0.
Well it's a devops task not a dev task. So not for 4.0 specifically, but the registry team could set this up if they need to do these queries
I tried tendermint postgres indexer and events are syncing. The only issue is tendermint events queries are not implemented for postgres indexer.
We have to write our own client to query events from postgres database.
This doc contains instructions to setup Postgres indexer Doc. cc: @clevinson
Thanks @aleem1314 !
@dpdanpittman will take a look at integrating this into our docs.
We should have a Postgres database in heroku with all our events indexed already. Why can't we just use that?
I've reassigned this issue to myself. I'm going to try to move this forward alongside the state machine work.