graphprotocol / graphprotocol/hypergraph

Mechanism to await a mutation and be sure it was indexed

Offen
#237 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Schema SDK
Vorherrschende Sprache
TypeScript
Sterne
22
Forks
12
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das grc-20-ts-Tooling und seine Einstiegspunkte für publish, sync und die indexer-API zu lokalisieren. Vergleiche die Ansätze polling, publish-through-API und block-hash und definiere anschließend die Abschlussbedingung des Mechanismus so, dass er erst zurückkehrt, wenn die Mutation im Index gefunden werden kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
api, blockchain, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.