Ethereum Insights with Elasticsearch and Kibana
Storing the Ethereum blockchain on Elasticsearch
Here at Kin Foundation, we’re developing tools for application so developers can easily interact with the blockchain based Kin ecosystem. Kin is a token currently implemented on the ERC20 standard on Ethereum blockchain.
Part of the abilities we’re trying to develop are tools to quickly and easily analyze the blockchain and get insights into the transactions. There are many blockchain explorers out there letting you look deeper into blocks, transactions and addresses, but we wanted to get an overview of the entire network.
Nitzan and I started fleshing out the idea. We used Kibana and Elasticsearch in the past and liked the flexibility they provide for running queries and the ease of creating visualizations and dashboards. We chose typescript to write the code that moves transactions from the blockchain to the datastore.
We wrote a node.js application (code available on github) that polls an Ethereum node and pushes entire blocks of transactions as they are created into Elasticsearch. For a quick setup of Kibana and Elasticsearch, we used a docker image that has both of them pre installed and ready to run.
To parse token transactions in addition to native ether transactions we used the open source web3-api-helper package to parse the input field of the transactions. We resolved contract addresses to their token name using myetherwallet’s tokens list.
What we ended up with was an entry for each transaction in its native currency’s value
, to
and from
.
Even though this was a pet project, we were able to find and fix a few issues on web3.js.
Time to Analyze
All the images below are taken from Kibana and the data is a snapshot from January 13th 2018 (UTC).
Here are some questions we asked and graphs we produced to answer them:
What is the rate of mined transactions and blocks?
What are the most transacted tokens?
How much token value is transferred?
Who spends the most ether?
What portion of transactions are token based?
What is the gas limit price over time?
As Kibana dashboards are dynamic, we can click on the cloud of top tokens and select KIN to filter all other graphs and show only KIN transactions.
We’re sure there are many more interesting questions that this dataset can answer, can you think of some?
*tokens that we were able to parse according to our snapshot off myetherwallet’s supported tokens list.