Chain Stats Plugin

There's a plug-in currently being developed for steemd that will expose a set of RPCs to get statistical information about the blockchain. The plug-in is called chain_stats_api.

Keep in mind, this is currently a work in progress.


To enable it in steemd, modify your config.ini thusly:

public-api = database_api login_api market_history_api follow_api chain_stats_api
.
.
.
enable-plugin = chain_stats

Then restart steemd. To try it out, use curl, assuming your RPC Endpoint is on localhost, port 8090:

curl -X POST -d '{"jsonrpc": "2.0", "params": ["chain_stats_api", "get_lifetime_stats", []], "id":1, "method":"call"}' http://localhost:8090

The output of get_lifetime_stats will look something like this:

{
   "id":1,
   "result":{
      "blocks":6925035,
      "bandwidth":0,
      "operations":13446607,
      "transactions":0,
      "transfers":207848,
      "steem_transferred":"52717423238",
      "sbd_transferred":"42194634865",
      "sbd_paid_as_interest":0,
      "accounts_created":111703,
      "paid_accounts_created":100340,
      "mined_accounts_created":11363,
      "total_comments":1403704,
      "total_comment_edits":412792,
      "total_comments_deleted":14201,
      "root_comments":277953,
      "root_comment_edits":266317,
      "root_comments_deleted":1490,
      "replies":1125751,
      "reply_edits":146475,
      "replies_deleted":12711,
      "total_votes":9314301,
      "new_votes":73726,
      "changed_votes":9240575,
      "total_root_votes":7958083,
      "new_root_votes":61554,
      "changed_root_votes":7896529,
      "total_reply_votes":1356218,
      "new_reply_votes":12172,
      "changed_reply_votes":1344046,
      "payouts":0,
      "sbd_paid_to_authors":0,
      "vests_paid_to_authors":0,
      "vests_paid_to_curators":0,
      "liquidity_rewards_paid":0,
      "transfers_to_vesting":125496,
      "steem_vested":"16629130503",
      "new_vesting_withdrawal_requests":4869,
      "modified_vesting_withdrawal_requests":7807,
      "vesting_withdraw_rate_delta":"95170041056922914",
      "vesting_withdrawals_processed":0,
      "finished_vesting_withdrawals":0,
      "vests_withdrawn":0,
      "vests_transferred":0,
      "sbd_conversion_requests_created":10048,
      "sbd_to_be_converted":2282219583,
      "sbd_conversion_requests_filled":0,
      "steem_converted":0,
      "limit_orders_created":285857,
      "limit_orders_filled":0,
      "limit_orders_cancelled":140043,
      "total_pow":195553,
      "estimated_hashpower":"28258735"
   }
}

So, to reiterate, the results are incorrect at the time of writing this article. Just looking at the transactions key, we can see there's a problem (it's zero).

The RPC methods are:

  • get_stats_for_time - arguments: open, interval, e.g.: "20161031T235959", 1000
  • get_stats_for_interval - arguments: start, end, e.g.: "20161001T000000", "20161031T235959"
  • get_lifetime_stats - no arguments

It seems like get_stats_for_time and get_stats_for_interval are more accurate than get_lifetime_stats, just from a cursory analysis. But it's something to keep an eye on!!

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
6 Comments