graphprotocol / graphprotocol/hypergraph
Mechanism to await a mutation and be sure it was indexed
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 22
- Fork
- 12
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando il tooling grc-20-ts e i relativi entry point per publish, sync e l’indexer-API. Confronta gli approcci polling, publish-through-API e block-hash, quindi definisci la condizione di completamento del meccanismo in modo che ritorni solo dopo che la mutation può essere trovata nell’indice.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- api, blockchain, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100