Unveiling the Outpost API

Built in the spirit of visualizing macroeconomic blockchain insights of Cosmos in an effort to bring an awareness to all crypto communities on the importance of stepping back to look at the bigger picture

Jack Chan
KysenPool
6 min readMar 12, 2020

--

The Outpost API was first built to support the Tendermint-base Cosmos Network to discover the underlying trends of this year-old blockchain. As part of building out KysenPool, we realized that there were quite a number of efforts to build out chain explorers and diving into chain analytics, but there was little emphasis on visualizing what the underlying trends really looks like.

There could be a lot of hype in a particular chain but when rubber meets the road, the analysis of the trends of how practical each blockchain is being used will reveal its true value, especially if it reveals growing positive trends over time.

The Outpost API is highly specific in this proof of concept version that traces the following blockchain message types inherent to the Cosmos Network, in order to help trend out the following activities:

  • Delegations / ReDelegations / UnDelegations — the amount of token delegations being moved in and out of validators
  • Rewards & Commissions — how active the community is in really building automations around maximizing their rewards and pulling their commissions to be maximize utility
  • Send Transaction Volume — how many token transfers are happening and at what total volume in each block of time
  • Success & Failure Rates — how well the ecosystem is built out, whether via automation scripts, or via dApps are they operating to push transactions through the chain without running out of gas or running haphazard scripts
  • Validator Uptime — how secure and lively is the underlying mini-data centers supporting the cryptography behind each block being verified and signed
Network Stat screen

API URL

First off, the backend API is publicly available and it’s simply https://api.cosmosoutpost.io

NOTE: Ok, now we’ve revealed it! Please be kind to keep your search time range within reasonable limits (e.g. 30 days) to avoid hitting the API too hard and taxing the backend indexing service. It’s not built for public use hence there’s no auto-scaling just yet. This a beta build-out on a shoestring budget! To help support us, there’s a delegation link at the end of this post to help support our cause.

Example

Resolutions

Secondly, note that there’s a concept of resolutions. The API supports data density in the following resolutions:

Meaning it gives you the ability to manage the data fidelity that you’re interested in within an overarching time window delimited by a “from” and “to” timestamp.

For example, if you set your resolution to “5m” to summarize 5-minute resolution buckets, and your timestamped window happens to be 24 hours apart, then you expect to receive see 288 record sets representing the activities in that 24 hour period.

Request Params

The following are the general parameters used in every endpoint

  • from_time_in_millis : time in UTC since epoch, in milliseconds, to start from
  • to_time_in_millis : time in UTC since epoch, in milliseconds, to end at
  • resolution : (optional) how dense to group them together in, supported values are 1m / 5m / 15m / 1h / 4h / 1d (default is 1m, or 60000ms)

Enjoy!

Delegations

Supported message types: MsgBeginRedelegate, MsgDelegate, MsgUndelegate

Request URI

Response Sample

Rewards

Supported message types: MsgWithdrawDelegationReward, MsgWithdrawValidatorCommission

Request URI

Response Sample

Send / Receive

Supported message types: MsgSend, MsgMultiSend

Request URI format

Sample Response

Success & Failure Rates

This is a side effect of a completed transaction

Request

Response Sample

Now, onto Validator Uptime!

Validator Uptime screen — green = actively signing pre-commits / blue = proposing a block / red = inactive and not signing

Validator Uptime

We basically check to see whether a validator has submitted pre-commits during this block. If there was none, then it’s considered an outage, or a missed pre-commit, during this block, where the validator was either unreachable, or did not submit a pre-commit in time before the wait interval is up, after gaining the 2/3 consensus. The response will also include the validator address of the“proposer” as a separate element at the root of the response

Request URI

Request Params

  • “active” — pull all active validators
  • validator’s address hex, e.g. 9DF8E338C85E…
  • number of block height counts, counting back from the most recent block. Defaults to 100

You can optionally look for a single validator’s uptime, or look for all “active” validators. If a validator is down, it will be missing from the active set.

Response Sample

The following is a response payload for the “active” set

Alternatively if the request is only asking for a “single” validator

NOTE: Unfortunately we have yet to build out a mapping from the validator hex address to the validator name

That’s basically it! Hope this has been useful

Official Channels

Twitter: twitter.com/KysenPool
Medium:
medium.com/kysenpool
Telegram:
https://t.me/kysenpool
WeChat: KysenPool
LinkedIn:
www.linkedin.com/company/kysen-technologies

--

--

Jack Chan
KysenPool

Engineering away at Web Scalability and Blockchains