scaffold-eth / buidlguidl-v3

https://app.buidlguidl.com/
MIT License
14 stars 18 forks source link

Display ENS Avatar if user has ENS #102

Open gotnoshoeson opened 1 month ago

gotnoshoeson commented 1 month ago

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:

I pretty much have this working already.

carletex commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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!