Open Source the IC-API that powers the Internet Computer Dashboard

Motivation

Over the past couple of months, I’ve asked or raised the point several times asking for the IC-API to be open sourced.

Others have also inquired asking for more visibility into this API

The only response thus far that I’ve received is:

What is the IC-API

The IC-API exposes many important IC stats such as subnet state size, # of canisters, transaction and cycle burn rate, account & transaction history, as well as neuron voting history. The IC-API powers the Internet Computer Dashboard, and several other prominent applications that pull various statistics from this API.

You can several of the API endpoints through their swagger dashboard here - Public Dashboard API, and there is also a v3/ (https://ic-api.internetcomputer.org/api/v3) API for which I cannot find any swagger or other documentation.

Why is it important that the IC API is open sourced?

We now have many promising signs that the IC is growing rapidly during this bear market, such as through the impressive cycles burn rate spikes shown via this Tweet from @chepreghy

Much of the data incorporated into the IC Dashboard is all based on an off-chain CDN backed portion of the IC-API hosted on Cloudflare to handle large, aggregate data (too big for the IC?) and service in a performant fashion (too slow for the IC?), for which the code is closed source and owned by DFINITY (via the Internet Computer Association).

The foundation has also referenced the IC-Dashboard (which is powered by the IC-API) to give proof of their neuron holdings DFINITY Foundation Voting Power - #2 by diegop.

Until this code is open sourced and verifiable or another team builds their own API, we as a community cannot 100% trust the data coming from the IC-API, any marketing or promotion coming resulting from this data, or any products that directly incorporate this data (i.e. the IC Dashboard).

13 Likes

This seems like a very reasonable request.

10 Likes

Very good proposal, but what about the possibility of modifying the source code of the official dashboard vs the one that’s open sourced, you can never know what runs behind the scenes on a website you browse, so basically if someone doesn’t trust the official dashboard will have to host his own from this open source code in order to make sure it’s the same?

If the dashboard existed in a a canister people could compare the Wasm hash to verify that it was produced from the source code it was supposed to originate from.

5 Likes

Sure, but the the bigger issue isn’t the dashboard frontend.

It’s the API and the pipeline feeding into the data store and cdn of which all of the dashboard data is coming from.

Without that being open sourced, the community has no idea about the data pipeline coming from the IC into the API data store, and it follows that we can’t know if the dashboard and IC stats data is completely accurate. We also don’t know if neurons or voting power are being hidden, etc.

Think about this - you’re building codebase for an ecosystem and network you think is expanding based on dashboard stats - but you have no idea if those are 100% accurate or not, and what the data and code backing those stats looks like. Exposing this in the API code would be the proof that the governance and network usage data is legitimate.

I also think that DFINITY would want to open source this so that external teams can build their own 3rd party explorer UIs to pull data from the IC-API or build their own network stats APIs, so I have no idea why DFINITY hasn’t given an official response to this post or the other times I’ve asked this question.

@diegop I know you’re busy, but can you possibly track this down for? (Give a reason as to why the IC API and is not open sourced?).

9 Likes

Update: I did escalate this within DFINITY R&D team.

  • DFINITY agrees with open sourcing the dashboard code. The teams need to do more clean up and security reviews, so it is “on the path.” Being realistic (and to set expectations), I would say this would be measured in months not weeks based on my experience in open sourcing key infrastructure pieces at DFINITY (clean up, docs, security reviews + follow up from security reviews).

For context: This falls under the purview of @jeff’s team (who own the dashboard).

11 Likes

Is the frontend repo for the dashboard (dashboard.internetcomputer.org) open source?

4 Likes

Good question. Let me ask @jeff and the dashboard team.

I’ve scraped these v3 endpoints from dashboard.internetcomputer.org
Putting them here in case anybody finds them interesting.
Open sourcing this would be nice.

- https://ic-api.internetcomputer.org/api/v3/metrics/cycle-burn-rate
- https://ic-api.internetcomputer.org/api/v3/metrics/block-rate
- https://ic-api.internetcomputer.org/api/v3/metrics/message-execution-rate
- https://ic-api.internetcomputer.org/api/v3/metrics/registered-canisters-count
- https://ic-api.internetcomputer.org/api/v3/metrics/max-transactions-per-sec-over-90-days
- https://ic-api.internetcomputer.org/api/v3/metrics/average-cycle-burn-rate
- https://ic-api.internetcomputer.org/api/v3/metrics/community-fund-total-staked
- https://ic-api.internetcomputer.org/api/v3/block-heights
- https://ic-api.internetcomputer.org/api/v3/metrics/ic-memory-usage
- https://ic-api.internetcomputer.org/api/v3/metrics/internet-identity-user-count
- https://ic-api.internetcomputer.org/api/v3/metrics/latest-proposal-id
- https://ic-api.internetcomputer.org/api/v3/metrics/community-fund-total-maturity
- https://ic-api.internetcomputer.org/api/v3/metrics/instruction-rate
- https://ic-api.internetcomputer.org/api/v3/subnets
- https://ic-api.internetcomputer.org/api/v3/proposals
- https://ic-api.internetcomputer.org/api/v3/node-providers
- https://ic-api.internetcomputer.org/api/v3/nodes
- https://ic-api.internetcomputer.org/api/v3/neurons
- https://ic-api.internetcomputer.org/api/v3/data-centers
- https://ic-api.internetcomputer.org/api/v3/avg-icp-xdr-conversion-rates
- https://ic-api.internetcomputer.org/api/v3/icp-xdr-conversion-rates
- https://ic-api.internetcomputer.org/api/v3/boundary-node-locations
- https://ic-api.internetcomputer.org/api/v3/metrics/total-rewardable-nodes-count
- https://ic-api.internetcomputer.org/api/v3/metrics/ic-nodes-count
- https://ic-api.internetcomputer.org/api/v3/metrics/boundary-nodes-count
- https://ic-api.internetcomputer.org/api/v3/node-providers-count
- https://ic-api.internetcomputer.org/api/v3/metrics/ic-subnet-total
- https://ic-api.internetcomputer.org/api/v3/metrics/total-ic-energy-consumption-rate-kwh
- https://ic-api.internetcomputer.org/api/v3/metrics/node-energy-consumption-rate-kwh
- https://ic-api.internetcomputer.org/api/v3/staking-metrics
- https://ic-api.internetcomputer.org/api/v3/metrics/governance-neurons-total
- https://ic-api.internetcomputer.org/api/v3/metrics/governance-voting-power-total
- https://ic-api.internetcomputer.org/api/v3/metrics/last-reward-event
- https://ic-api.internetcomputer.org/api/v3/metrics/average-governance-voting-power-total
- https://ic-api.internetcomputer.org/api/v3/metrics/average-last-reward-event
- https://ic-api.internetcomputer.org/api/v3/participation-rates
- https://ic-api.internetcomputer.org/api/v3/neuron-voting-powers
- https://ic-api.internetcomputer.org/api/v3/neuron-maturity-modulations
- https://ic-api.internetcomputer.org/api/v3/staking-metrics/governance_dissolving_neurons_e8s_bucket
- https://ic-api.internetcomputer.org/api/v3/staking-metrics/governance_not_dissolving_neurons_e8s_bucket
- https://ic-api.internetcomputer.org/api/v3/staking-metrics/governance_dissolved_neurons_e8s
- https://ic-api.internetcomputer.org/api/v3/staking-metrics/governance_neurons_with_less_than_6_months_dissolve_delay_e8s
- https://ic-api.internetcomputer.org/api/v3/subnet-replica-versions
- https://ic-api.internetcomputer.org/api/v3/canisters

4 Likes

Here’s the Swagger link for the ic-api v3:
https://ic-api.internetcomputer.org/api/v3/swagger

3 Likes

We do publish a swagger interface and a redoc interface with all of the public APIs

https://ic-api.internetcomputer.org/api/v3/swagger
And
https://ic-api.internetcomputer.org/api/v3/redoc

3 Likes

That’s very nice!

I guess the next step is to open source the IC-API itself, in particular:

  1. Where do all the data come from. What data can be read by querying certain canisters? Any access restrictions involved in reading such data? What data can’t be read publicly yet (e.g. requiring node access, or network topology knowledge)?
  2. (less important) the data pipelines used to generate the API response.

If not everything can be practically open sourced at this point, I think it’d be nice to at least partially open source this, especially those related to neurons and voting.

1 Like

Is there a way to get the complete list of ICP transactions from the Ledger Canister?

If you want to pull down all transactions, we recommend using the Rosetta API

1 Like

Where can I find the data for neuron delegations? Thanks!

Hi, when will “Node Provider Rewards” data (from Circulation - ICP Dashboard) be available as API? Thank you.

Hi zlysunshine. Followees are not exposed in a public manner. Those can also be accessed by the controller or hotkey using get_full_neuron or list_neurons endpoints on the governance canister.

4 Likes

You can find the node provider rewards data from the following endpoint: https://ic-api.internetcomputer.org/api/v3/timeseries/reward-node-providers?end=1695057448&step=86400&start=1620604799

4 Likes

Thank you! Is it available as a single data (total) ?
Like this for example: https://ic-api.internetcomputer.org/api/v1/transactions/icp-burned

This endpoint currently does not supply the total as a single data point, so I will add that as a bugfix ticket on our end. We should have that done and deployed within the next 2 weeks.

3 Likes