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

Display ENS Avatar if user has ENS #102

Open
gotnoshoeson opened this issue May 26, 2024 · 3 comments
Open

Display ENS Avatar if user has ENS #102

gotnoshoeson opened this issue May 26, 2024 · 3 comments

Comments

@gotnoshoeson
Copy link

Display ENS Avatar if builder has an ENS. Continue using QRPunkBlockie if builder doesn't have ENS or if their ENS avatar isn't set.

Will affect the following components:

  • Account component used to show logged in user in the Header
  • Address component that is used in Activity page, Builders page and Vote Builds page
  • BuilderProfileCard that is used in the dynamic route for builders / builders' portfolio dashboard

I pretty much have this working already.

@carletex
Copy link
Member

Hey @gotnoshoeson thank for opening the issue. We've talked about this a few times and I think it's a good idea!

If we haven't implemented it yet it's because we were worried about performance, and were thinking about caching ideas. Hitting the /builders page and requesting everyone's avatar will make a bunch of requests.

I pretty much have this working already.

Are you using any caching mechanism? Are you using an API or RPC calls? Feel to open a draft PR and we can discuss there.

Thanks.

@gotnoshoeson
Copy link
Author

Thanks @carletex ,

Realizing that my solution isn't very optimized; I'm using my own firebase db so it's pretty fast with only 5 users :) Currently utilizing RPC calls.

I'm now thinking a more scalable/optimized solution would be to hit the ENS subgraph endpoint with an array of builder addresses as an argument variable, that'd be one request/one response with all the needed data. I'll open a PR with this method.

@carletex
Copy link
Member

ENS subgraph endpoint with an array of builder addresses as an argument variable

This sounds great! Grouping addresses in a single request would save a lot.

My other idea was to cache it in Firebase (as we do with ENS names**).

** We save the resolved ENS name when a builder is created in the system. We'd also need a cron job to update (not happening at the moment). The other issue is that pages like /activity don't benefit (since we are not "joining" log data with the builder data (where the ENS name is saved). The good thing is that in the /builders page or an individual page, the data is already there.

Anyway, just thinking out loud! Feel free to PR and we can work from there.


Related: I found this too https://metadata.ens.domains/docs#/paths/~1%7BnetworkName%7D~1avatar~1%7Bname%7D/get. An API for getting ENS data :D

Thanks again for working on this, man!

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