Blockchain Analytics Now Available on IoTeX Explorer (iotexscan.io)!

Ever since we launched Mainnet in April, the IoTeX blockchain has performed exceptionally well. But don’t just take our word for it — we want you to see for yourself! We’re excited to announce a simple way for anyone to visualize data related to the IoTeX Network via the IoTeX Explorer (iotexscan.io).

We have added several query-able metrics to the IoTeX Explorer. Under the “Tools” section, you will find GraphQL Playground, which provides an intuitive way to visualize data and enable powerful developer tools. With a simple GraphQL command, you can easily query/create metrics related to the IoTeX Network.

In this blog, we provide an overview of GraphQL and an overview of the metrics available today. Try it out for yourself using the instructions below!

How to use GraphQL

A GraphQL service is created by defining “types”, and “fields” on those types. Functions are then provided to read each field on each type. For non-technical folks, GraphQL provides “responses” based on user-generated “requests”, allowing anyone to read/analyze code and data of the IoTeX Network.

There is no pre-installation required — just go to the GraphQL Playground, start a query{}, and request a metric you are interested in. Each metric has various self-defined inputs (“requests”) that let you customize your queries.

Metrics Available Today

There are several metrics already available today in GraphQL playground. Over time, we will continue to add more and more useful metrics. Don’t see an important metric on the list? Let us know and we will be sure to add it!

  • Bookkeeping() — for Delegates, overview of reward distributions to voters
  • Productivity() — block productivity of Consensus Delegates
  • Rewards() — rewards received data for Delegates
  • ChainMeta() — metadata of IoTeX blockchain
  • AverageProductivity() — average block productivity for all Delegates
  • NumberOfCandidates() — number of Delegate candidates
  • NumberOfWeightedVotes() — total weighted votes
  • NumberOfActions() — number of actions (txns, smart contracts, votes)
  • ActiveAccount() — list of addresses that participated in latest actions
  • VotingInformation() — voting data (address, amount) for a Delegate

Each metric above has a set of requests (i.e., inputs) that generate unique responses (i.e., outputs). This allows you to specify at a granular level the exact data you are interested in — see our GraphQL documentation for more details and try out our GraphQL Playground today!


Bookkeeping()

Usage: for Delegates, provides reward distributions to their voters within a range of epochs

Request:

  • startEpoch: starting epoch number
  • epochCount: epoch count
  • delegateName: delegate name
  • includeFoundationBonus: whether include foundation bonus as part of the reward distribution
  • percentage: percentage of reward distribution

Response:

  • voterAddress: voter’s ERC20 address
  • amount: amount of reward distribution

Sample Request:

Sample Response:

Productivity()

Usage: block productivity of producers within a range of epochs.

Request:

  • startEpoch: starting epoch number
  • epochCount: epoch count
  • producerName: producer name

Response:

  • production: number of block productions
  • expectedProduction: number of expected block productions

Sample Request:

Sample Response:

Rewards()

Usage: reward detail information for candidates within a range of epochs.

Request:

  • startEpoch: starting epoch number
  • epochCount: epoch count
  • candidateName: candidate name

Response:

  • blockReward: amount of block rewards
  • epochReward: amount of epoch rewards
  • foundationBonus: amount of foundation bonus

Sample Request:

Sample Response:

ChainMeta()

Usage: ChainMeta provides metadata of IoTeX blockchain.

Request:

  • tpsBlockWindow: # of last blocks that are backtracked to compute TPS

Response:

  • mostRecentEpoch: latest epoch number
  • mostRecentBlockHeight: latest block height
  • mostRecentTPS: latest transactions per seconds

Sample Request:

Sample Response:

AverageProductivity()

Usage: the average block productivity within a range of epochs.

Request:

  • startEpoch: starting epoch number
  • epochCount: epoch count

Reponse:

  • averageProductivity: average productivity in percentage

Sample Request:

Sample Response:

NumberOfCandidates()

Usage: information about candidate number in a given epoch.

Request:

  • epochNumber: epoch number

Reponse:

  • totalCandidates: number of total candidates
  • consensusDelegates: number of consensus delegates

Sample Request:

Sample Response:

NumberOfWeightedVotes()

Usage: the total weighted votes in a given epoch

Request:

  • epochNumber: epoch number

Reponse:

  • numberOfWeightedVotes: number of weighted votes

Sample Request:

Sample Response:

NumberOfActions()

Usage: the total number of actions within a range of epochs.

Request:

  • startEpoch: starting epoch number
  • epochCount: epoch count

Response:

  • numberOfActions: number of actions

Sample Request:

Sample Response:

ActiveAccount()

Usage: list of account addresses that participate in the latest actions.

Request:

  • count: number of account addresses

Response:

  • activeAccount: list of account addresses

Sample Request:

Sample Response:

VotingInformation()

Usage: voting information for a given delegate in a given epoch

Request:

  • epochNum: epoch number
  • delegateName: delegate name

Response:

  • voterAddress: voter’s ERC20 address
  • weightedVotes: voter’s weighted votes

Sample Request:

Sample Response:

What’s Next?

We hope this helpful data visualization tool will help everyone — voters, developers, Delegates — understand IoTeX blockchain more. We encourage you to build your own front end data visualizations leveraging our GraphQL Playground. Please reach out to an IoTeX team member if you have any questions or suggestions!


About IoTeX

Founded as an open-source project in 2017, IoTeX is building the world’s leading privacy-centric blockchain platform for the Internet of Things (IoT). Their mission is to build a decentralized trust fabric for a new era of collaboration and data exchange among devices, applications and people. Backed by a global team of research scientists and top engineers, IoTeX combines blockchain, trusted hardware and edge computing to realize the full potential of IoT.

Stay connected with us!

Website: https://iotex.io/
Twitter:
https://twitter.com/iotex_io
Telegram Announcement Channel:
https://t.me/iotexchannel
Telegram Group:
https://t.me/IoTeXGroup
Medium:
https://medium.com/@iotex
Reddit:
https://www.reddit.com/r/IoTeX/
Join us:
https://iotex.io/careers