Skip to content
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

Search Functionality #7

Open
owocki opened this issue Jan 13, 2024 · 1 comment
Open

Search Functionality #7

owocki opened this issue Jan 13, 2024 · 1 comment

Comments

@owocki
Copy link
Contributor

owocki commented Jan 13, 2024

Requested at https://gov.optimism.io/t/easyretropgf-xyz-run-your-own-optimism-style-rpgf-round/7359/5

@carlbarrdahl
Copy link
Contributor

carlbarrdahl commented Jan 15, 2024

To enable search within the metadata we would need to either:

1. Build an indexer that downloads all the Attestations and their metadata

This could be done like this:

  • Function to query EAS graphql for all the relevant attestations
  • Download the metadata for each attestation
  • Store in a Postgres database
  • Use alchemy custom webhooks to listen to Attested and Revoked events on the EAS contract and update db accordingly

2. Index while metadata is fetched

  • When a metadata request is made, store the results in a postgres table (indexKey, title, description, type)
  • Create an endpoint to query this table

This will only index the metadata that has been fetched by a user.
If an attestation is revoked, how would this db be updated?

It might be possible to create a custom cache for https://github.com/mistval/node-fetch-cache that does this in a clean way.

3. Use an existing indexer

Option 1 is more complex and manages a copy of the EAS db.
Option 2 still uses EAS as source of truth but could be challenging to remove revoked projects or lists.
Option 3 might be the cleanest solution but introduces an external dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants