graphprotocol / graphprotocol/hypergraph
Mechanism to await a mutation and be sure it was indexed
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 22
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
You can get the transaction hash and block number back from the chain at publish-time, but there’s no guarantee that the transaction has actually been indexed yet. We run into this problem in the web app, too. We solve it by just keeping published data in the local store even after it’s published until the user leaves the page. (edited)
There’s a few solution spaces
- Have a mechanism to poll the API looking for your edit id and return when it finds it (this can just be part of syncing in the future)
- Publish edits through an API which returns when it finds your edit in the indexer API
- I think we should incorporate block hash into the API. So you can say “query as of this block hash” or where block > x, or something like that and have a metadata field so you can get back from the server what block it was executed against. I think that should get us through the story here
Probably should be tooling that exists in grc-20-ts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the grc-20-ts tooling and its publish, sync, and indexer-API entry points. Compare the proposed polling, publish-through-API, and block-hash approaches, then define the mechanism's completion condition as returning only after the mutation can be found in the index.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, blockchain, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100