Closed blushi closed 1 year ago
EventCreateProject
will be emitted when a new Project
is created in state and EventUpdateProjectAdmin
will be emitted when the admin is updated in state.
regen.ecocredit.v1.EventCreateProject
regen.ecocredit.v1.EventUpdateProjectAdmin
After double checking the code, we just query for all projects https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.v1#regen.ecocredit.v1.Query.Projects with a single query and then we can look up the admins in the result list of projects directly so I guess indexing projects admins could be nice to have because we could have a more efficient query like "get projects by admin address" but I don't think this is mandatory to improve significantly the performance, while indexing credit class issuers #30 will be a real game-changer in this case.
EDIT: Regen Ledger already provides such a query https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.v1#regen.ecocredit.v1.Query.ProjectsByAdmin so we could just use that instead as part of https://github.com/regen-network/rnd-dev-team/issues/1757 instead of the current code: https://github.com/regen-network/regen-web/blob/7a15d9302d04786f9ee83229fd58ad2befd1c591/web-registry/src/hooks/useQueryListProjects.ts#L28
Let's close this for now and try using https://buf.build/regen/regen-ledger/docs/main:regen.ecocredit.v1#regen.ecocredit.v1.Query.ProjectsByAdmin instead. If we feel like we do need to index project admins, we can always re-open this.
Hey team! Please add your planning poker estimate with Zenhub @ryanchristo @wgwz