Query ENS and 0x contract events with SQL in Google BigQuery

Evgeny Medvedev
Coinmonks
Published in
2 min readOct 9, 2019

--

  • You can now easily query parsed ENS, 0x and many more (see below) smart contract events in Google BigQuery: 0x tables, ENS tables. Those tables are near real-time.
  • You can easily add events for any Ethereum contract you are interested in to public blockchain-etl datasets. Find instructions below.

Accessing Datasets in BigQuery

After you open the dataset links (0x tables, ENS tables) in your browser you should be able to see the blockchain-etl project and the available datasets within it on the left:

You can select each table and view its schema, details, and preview the data on the bottom right.

Try pasting this query to the editor on the top right and click the Run button to query the ETHRegistrarController_event_NameRegistered table:

select name, owner, cost
from `blockchain-etl.ethereum_ens.ETHRegistrarController_event_NameRegistered`
order by cost desc
limit 10

Adding Your Datasets and Tables

Follow the instructions here https://towardsdatascience.com/how-to-get-any-ethereum-smart-contract-into-bigquery-in-8-mins-bab5db1fdeee.

Other Datasets Available in BigQuery

Full list: https://github.com/blockchain-etl/ethereum-etl-airflow/tree/master/dags/resources/stages/parse/table_definitions

Get Best Software Deals Directly In Your Inbox

--

--