-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Ponder the source for truth #6
Comments
We can add a new table to the Ponder schema for cohort information, using the cohortContractAddress as the primary key and foreign key to the builders. The cohort name and URL may be saved manually (or using a UI) to this table. And then we can get that information from the same Ponder GraphQL endpoint. I'm checking the Ponder doc to see if there is a better option... @carletex The balance is the balance from the cohort contract, right? We can add a call to read the balance when indexing a new withdrawal and update a balance in the cohorts table. We have to listen to transfers to the contract too, Ponder has a new feature for this (https://ponder.sh/docs/accounts) |
Or we can create a Ponder API endpoint returning the same format used by the current BGv3 indexer, and get the cohort information from a JSON (since we need to add each cohort address to Ponder config to be indexed, we can add the name and the URL too). |
I think I like the option of creating a new table definition in the schema more since it seems that it'd be better integrated, and we can compose better queries from the clients And yeah, maybe we have to manually insert the data. Asked the same in #5 , but maybe there is a Ponder way of doing some seeding/migration scripts/etc. |
There is a custom setup event that can be used like a seeding but it's not exactly what we need https://ponder.sh/docs/api-reference/indexing-functions#setup-event I think that a fancy way to add the cohort name and url is to have a contract and some owners can add cohorts there, the contract throws an event with the cohort address, name, and url, and Ponder indexes this event. Maybe we can get the cohorts' addresses from this contract too, and we avoid having to add this on ponder config manually. What do you think? |
Currently, we have 2 sources that we use for cohorts / withdrawal data.
Ponder (this repo)
A custom indexer we created for BGv3.
BGv3 saves the data like this:
So I'd like to use this Ponder as the source of truth and sunset the BGv3 indexer. Then move any "client" that is using the BGv3 indexer to GraphQL requests to Ponder.
For that, we would need to store a few things:
I haven't explored what's the best way to go about it in Ponder, but would love to hear options!
The text was updated successfully, but these errors were encountered: