For a project I’m working on, I want to find all the names in the ENS. What I’d like is some way to get the list of all the names from the root contract, then interate over the TLDs, and so on. I’m no seeing any way to do this with web3.py, but I could be missing something obvious. Is there a better tools for this? Or is walking the ENS tree described in some doc I have overlooked?
I believe you need to use either Google BigQuary, pulling data from ens-manager.registrations.
Or use Duna, there request data from ethereumnameservice_ethereum.ETHRegistrarController_1 ; ethereumnameservice_ethereum.ETHRegistrarController_2 ; ethereumnameservice_ethereum.ETHRegistrarController_3 ;
ChatGPT will help you create an SQL request. Here is an example of such code for Google bq:
SELECT label, event_timestamp, cost FROM `ens-manager.registrations.Registraion periods` where event = 'registered'
As far as I know, there isn’t a one-click solution for this. However, there are methods that can help you achieve your goal. It’s important to note that no combination of these methods will provide an up-to-date list, as the complete index of currently registered names is dynamic due to name expiration and registration. There is no static list available.
To maintain a continually updated list of names, you would need a set of scripts that can monitor the registry contract and track name expirations. You can start with the code provided here. However, you’ll need to modify this script by specifying the
ensAddress to read from a source that loops through the addresses with registered names. Be sure to output that list of addresses to a file. Then, you can resolve the names associated with those addresses based on the query.
Additionally, you could include a query for the expiration of each name in a database and associate that name with an address. This way, you can recheck the name upon expiration. To keep this process ongoing, you can run it on a server to continually update the list by listening for changes in name registration for that address.
If you have any questions or if anyone has any additional suggestions on this workflow, feel free.
To be clear, I’m not looking for a “one-click solution”. I’m perfectly happy writing code to do the pulling if I can figure out which library to use. And of course I understand that the result will be out of date; I would need to have code to update the list periodically.
I’ll chase down both of these proposed methods, but I was really wondering if it was possible to do with a library like web3.py and access to the Ethereum blockchain itself. I thought that using the blockchain as the source of truth, instead of something that someone else derived, was the expected way to go.
Im willing to help you find a proper a solution. Send me a message if you would like.
GitHub - adraffy/ens-labels: Unique ENS Labels contains most names as a single file, however it’s maintained for a different purpose (testing Unicode and ENS normalization changes.)
How often are you updating this?
Hey there. I replied in email earlier today because I didn’t see a way to send personal replies or mail on this discussion site.
I’m definitely interested in the code you used for creating the list of names.
You all good? I can have someone work on this and publish a running database for the public, in no time.