How to get any Ethereum smart contract into BigQuery (in 8 mins)
Hit submit, and some magic happens under the hood. You’ll see a new box:
In this case we found 4 events in this Chainlink Oracle contract.
(2) Now, before downloading the table definitions, type in the name of your dataset. Some example datasets we already have are:
kyber(for Kyber Network)zeroex(for 0x Project)compound(for Compound)ens(for Ethereum Name Service)
Stick to lowercase and _-separated names to keep things consistent.
In this case, let’s say we name a new dataset chainlink:
(3) Click “Download Table Definitions”. This will download 1 JSON file per event in the smart contract. Each file contains a description that lets us generate the parser for that event in BigQuery.
(1) Assuming you have Git installed, fork the etherum-etl-airflow repository, and then clone it to your local machine:
git clone https://github.com/<your-github>/ethereum-etl-airflow.git
(2) Create a new branch, e.g. in our case:
git checkout -b feature/chainlink-events
(3) Now paste the table definition file you downloaded above into a new folder, with the name of your dataset (in our case: “chainlink”).
(4) Move this folder into the following path in the repository above:
dags/resources/stages/parse/table_definitions/
You’ll see our existing datasets there (airswap, compound, ens, etc).
(Optional): It would be fantastic if you add a sentence in each file to document what this event represents. The field table_description inside each JSON is the correct place to add this sentence.
(5) Git add, commit, and push your changes:
git add dags/resources/stages/parse/table_definitions/
git commit -m "Added Chainlink events"
git push --set-upstream origin feature/chainlink-events
Head to Github to complete the pull request.
3. Request a review and wait for approval
(1) Leave a comment on your PR saying that you used the Contract Parser:
“Used the Contract Parser: https://contract-parser.d5.ai”
(2) Request a review from Evgeny: medvedev1088 on Github
(3) Wait for approval and deployment!
Published at Tue, 03 Dec 2019 10:44:40 +0000
{flickr|100|campaign}
