Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ When modifying components:

## 6. Data Management

The app fetches data from Chainstack API:
The app fetches data from Chainstack's public pricing catalog:

* **API endpoint**: `https://console.chainstack.com/api/core/v1/calc/`
* **Catalog URL**: `https://static.chainstack.com/pricing/pricing_current.json`
* **Data processing**: `src/helpers/getData.js`
* **Caching**: Consider localStorage for performance
* **Error handling**: Display user-friendly messages
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ Production URL: [https://chainstats.org](https://chainstats.org)

## Data Source

- API endpoint: `https://console.chainstack.com/api/core/v1/calc/`
- Source path: `Enterprise.protocols`
- Inclusion rule in UI:
- Use only `dedicated` entries
- Include only nodes where `type === "public"`
- Skip entries without `node_info.storage.size_required`
- Catalog: `https://static.chainstack.com/pricing/pricing_current.json`, also used by the Chainstack pricing page.
- Read full and archive entries from `blockchains` with at least one dedicated cloud and a positive `total_storage_gb`.
- Display the largest estimate when the catalog lists several configurations for the same protocol, network, node type, and client. The catalog uses requested volume capacity or configuration defaults.

## Features

Expand All @@ -25,7 +22,7 @@ Production URL: [https://chainstats.org](https://chainstats.org)
## Stack

- React 19
- Vite 7
- Vite 8
- Ant Design 6
- Sass
- Axios
Expand Down Expand Up @@ -57,14 +54,15 @@ Open [http://localhost:5173](http://localhost:5173).
- `npm run build`: create production build in `dist/`.
- `npm run preview`: preview built app locally.
- `npm run test`: run Vitest (`--passWithNoTests`).
- `npm run check:protocol-icons`: compare visible API protocols to icon map coverage.
- `npm run check:protocol-icons`: validate the pricing catalog and report custom icon coverage and fallback badge usage.
- `npm run deploy`: publish `dist/` to GitHub Pages.

## CI

Workflow: `.github/workflows/ci.yml`

Runs:

1. `npm ci`
2. `npm run check:protocol-icons`
3. `npm run build`
Expand Down
14 changes: 7 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Blockchain Size - How Much Storage Does A Blockchain Use?</title>
<title>Blockchain Size | Estimated Node Storage</title>
<meta
name="title"
content="Blockchain Size - How Much Storage Does A Blockchain Use?"
content="Blockchain Size | Estimated Node Storage"
/>
<meta
name="description"
content="Ever wondered what is the size of a blockchain in terms of storage? See how many gigabytes of data are stored on the main blockchain networks."
content="Compare estimated storage for dedicated full and archive blockchain nodes by network and client."
/>

<meta property="og:type" content="website" />
<meta property="og:url" content="https://chainstats.org" />
<meta
property="og:title"
content="Blockchain Size - How Much Storage Does A Blockchain Use?"
content="Blockchain Size | Estimated Node Storage"
/>
<meta
property="og:description"
content="Ever wondered what is the size of a blockchain in terms of storage? See how many gigabytes of data are stored on the main blockchain networks."
content="Compare estimated storage for dedicated full and archive blockchain nodes by network and client."
/>
<meta property="og:image" content="https://chainstats.org/og-image.png" />

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:url" content="https://chainstats.org" />
<meta
name="twitter:title"
content="Blockchain Size - How Much Storage Does A Blockchain Use?"
content="Blockchain Size | Estimated Node Storage"
/>
<meta
name="twitter:description"
content="Ever wondered what is the size of a blockchain in terms of storage? See how many gigabytes of data are stored on the main blockchain networks."
content="Compare estimated storage for dedicated full and archive blockchain nodes by network and client."
/>
<meta name="twitter:image" content="https://chainstats.org/og-image.png" />

Expand Down
59 changes: 13 additions & 46 deletions scripts/check-protocol-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ const path = require('path');
const https = require('https');
const http = require('http');

const API_URL =
process.env.CHAINSTACK_CALC_API ||
'https://console.chainstack.com/api/core/v1/calc/';

const projectRoot = path.resolve(__dirname, '..');
const protocolMetadataPath = path.join(
projectRoot,
Expand Down Expand Up @@ -86,58 +82,29 @@ const fetchJson = (url) => {
});
};

const getVisibleProtocolDisplayNames = (protocols) => {
const visibleProtocols = new Set();

Object.entries(protocols).forEach(([protocolSlug, networks]) => {
Object.values(networks).forEach((networkData) => {
if (networkData && networkData.dedicated) {
const hasPublicNode = ['full', 'archive'].some((nodeType) => {
const nodes = networkData.dedicated[nodeType];

if (!nodes) {
return false;
}

return Object.values(nodes).some((nodeConfig) => {
const sizeRequired = nodeConfig?.node_info?.storage?.size_required;
return nodeConfig?.type === 'public' && sizeRequired != null;
});
});

if (hasPublicNode) {
visibleProtocols.add(formatProtocolDisplayName(protocolSlug));
}
}
});
});

return visibleProtocols;
};

const main = async () => {
const payload = await fetchJson(API_URL);
const protocols = payload?.Enterprise?.protocols;

if (!protocols) {
throw new Error('Unexpected API response: missing Enterprise.protocols');
}
const { PRICING_CATALOG_URL, parsePricingCatalog } = await import(
'../src/helpers/pricingCatalog.mjs'
);
const payload = await fetchJson(process.env.CHAINSTACK_CALC_API || PRICING_CATALOG_URL);
const networks = parsePricingCatalog(payload);

const iconKeys = extractIconKeys();
const visibleProtocolNames = getVisibleProtocolDisplayNames(protocols);
const visibleProtocolNames = new Set(
networks.map(({ protocol }) => formatProtocolDisplayName(protocol))
);

const missingIconProtocols = Array.from(visibleProtocolNames)
const fallbackNames = [...visibleProtocolNames]
.filter((protocolName) => !iconKeys.has(protocolName))
.sort();
const mappedCount = visibleProtocolNames.size - fallbackNames.length;

if (missingIconProtocols.length) {
console.error('Protocol icons missing for one or more visible protocols.');
process.exitCode = 1;
return;
if (fallbackNames.length) {
console.warn(`Fallback badges used for ${fallbackNames.join(', ')}.`);
}

console.log(
`Protocol icon check passed for ${visibleProtocolNames.size} visible protocols`
`Custom icons available for ${mappedCount} of ${visibleProtocolNames.size} visible protocols.`
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Header(props) {
<div className="header_left__labels">
<h1 className="name">Blockchain size</h1>
<h2 className="description">
What is total amount of data stored within a blockchain network?
Storage estimates for full and archive nodes by network and client
</h2>
</div>
</div>
Expand Down
64 changes: 59 additions & 5 deletions src/components/ProtocolIcon/ProtocolIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,66 @@
import React from 'react';

import AdiChain from './adichain.svg';
import Aptos from './aptos.svg?react';
import Arbitrum from './arbitrum.svg?react';
import Arc from './arc.png?no-inline';
import Astar from './astar.svg';
import Aurora from './aurora.svg?react';
import Avalanche from './avalanche.svg?react';
import Base from './base.svg?react';
import Berachain from './berachain.svg';
import Bitcoin from './bitcoin.svg?react';
import Bittensor from './bittensor.svg?react';
import Bnb from './bnb.svg?react';
import Cardano from './cardano.svg';
import Cronos from './cronos.svg?react';
import Elysium from './elysium.svg';
import Ethereum from './ethereum.svg?react';
import Etherlink from './etherlink.svg';
import Fantom from './fantom.svg?react';
import Filecoin from './filecoin.svg?react';
import Fuse from './fuse.svg?react';
import Gnosis from './gnosis.svg?react';
import Harmony from './harmony.svg?react';
import Ink from './ink.svg';
import Jovay from './jovay.svg';
import Kaia from './kaia.svg';
import Katana from './katana.jpg?no-inline';
import Linea from './linea.svg';
import Litecoin from './litecoin.svg';
import Mind from './mind.svg';
import Near from './near.svg?react';
import NeoX from './neox.svg';
import Optimism from './optimism.svg?react';
import Pharos from './pharos.svg';
import Plume from './plume.svg';
import PolygonPOS from './polygonPOS.svg?react';
import PolygonZkEvm from './polygonZkEvm.svg?react';
import Robinhood from './robinhood.svg';
import Ronin from './ronin.svg?react';
import Scroll from './scroll.svg?react';
import Solana from './solana.svg?react';
import Starknet from './starknet.svg?react';
import Stellar from './stellar.png?no-inline';
import Sui from './sui.svg';
import Tac from './tac.png?no-inline';
import Taiko from './taiko.svg';
import Tezos from './tezos.svg?react';
import ZkSync from './zkSync.svg?react';
import Tron from './tron.svg?react';
import Sonic from './sonic.svg?react';
import Celo from './celo.svg?react';
import Hyperliquid from './hyperliquid.svg?react';
import Klaytn from './klaytn.svg?react';
import Megaeth from './megaeth.svg?react';
import Monad from './monad.svg?react';
import Plasma from './plasma.svg?react';
import Tempo from './tempo.svg?react';
import Unichain from './unichain.svg?react';
import Xdc from './xdc.svg';
import XLayer from './xlayer.png?no-inline';
import XrpLedger from './xrpl.png?no-inline';
import Zcash from './zcash.svg';
import ZkLink from './zklink.svg';
import './ProtocolIcon.scss';

const TextBadgeIcon = ({ label, color }) => (
Expand All @@ -48,40 +75,67 @@ const TextBadgeIcon = ({ label, color }) => (
);

const iconTypes = {
'ADI Chain': <img src={AdiChain} alt="" />,
Aptos: <Aptos />,
Arbitrum: <Arbitrum />,
Arc: <img src={Arc} alt="" />,
Astar: <img src={Astar} alt="" />,
Aurora: <Aurora />,
Avalanche: <Avalanche />,
Base: <Base />,
Berachain: <img src={Berachain} alt="" />,
Bitcoin: <Bitcoin />,
Bittensor: <Bittensor />,
'BNB Smart Chain': <Bnb />,
Cardano: <img src={Cardano} alt="" />,
Cronos: <Cronos />,
Elysium: <img src={Elysium} alt="" />,
Ethereum: <Ethereum />,
Etherlink: <img src={Etherlink} alt="" />,
Fantom: <Fantom />,
Filecoin: <Filecoin />,
Fuse: <Fuse />,
Gnosis: <Gnosis />,
'Gnosis Chain': <Gnosis />,
Harmony: <Harmony />,
Ink: <img src={Ink} alt="" />,
Jovay: <img src={Jovay} alt="" />,
Kaia: <img src={Kaia} alt="" />,
Katana: <img src={Katana} alt="" />,
Linea: <img src={Linea} alt="" />,
Litecoin: <img src={Litecoin} alt="" />,
Mind: <img src={Mind} alt="" />,
Near: <Near />,
'Neo X': <img src={NeoX} alt="" />,
Optimism: <Optimism />,
Pharos: <img src={Pharos} alt="" />,
Plume: <img src={Plume} alt="" />,
'Polygon PoS': <PolygonPOS />,
'Polygon zkEVM': <PolygonZkEvm />,
'Robinhood Chain': <img src={Robinhood} alt="" />,
Ronin: <Ronin />,
Scroll: <Scroll />,
Solana: <Solana />,
Starknet: <Starknet />,
Stellar: <img src={Stellar} alt="" />,
Sui: <img src={Sui} alt="" />,
TAC: <img src={Tac} alt="" />,
Taiko: <img src={Taiko} alt="" />,
Tezos: <Tezos />,
zkSync: <ZkSync />,
TRON: <Tron />,
Sonic: <Sonic />,
Celo: <Celo />,
Klaytn: <Klaytn />,
Hyperliquid: <Hyperliquid />,
Megaeth: <Megaeth />,
MegaETH: <Megaeth />,
Monad: <Monad />,
Plasma: <Plasma />,
Tempo: <Tempo />,
Unichain: <Unichain />,
'XDC Network': <img src={Xdc} alt="" />,
'X Layer': <img src={XLayer} alt="" />,
'XRP Ledger': <img src={XrpLedger} alt="" />,
Zcash: <img src={Zcash} alt="" />,
zkLink: <img src={ZkLink} alt="" />,
'ZKsync Era': <ZkSync />,
};

const ProtocolIcon = ({ protocolName = '' }) => {
Expand Down
5 changes: 4 additions & 1 deletion src/components/ProtocolIcon/ProtocolIcon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
display: inline-flex;
width: 18px;
height: 18px;
flex: 0 0 18px;
align-items: center;
justify-content: center;
color: var(--color-typo-primary);

svg {
svg,
img {
width: 18px;
height: 18px;
display: block;
object-fit: contain;
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/components/ProtocolIcon/ProtocolIcon.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import { describe, expect, it } from 'vitest';
import ProtocolIcon from './ProtocolIcon';

describe('ProtocolIcon', () => {
it.each(['Megaeth', 'Monad', 'Plasma', 'Tempo', 'Unichain'])(
it.each(['MegaETH', 'Monad', 'Plasma', 'Tempo', 'Unichain', 'ZKsync Era'])(
'renders an SVG icon for %s',
(protocolName) => {
const { container } = render(<ProtocolIcon protocolName={protocolName} />);
expect(container.querySelector('svg')).toBeTruthy();
}
);

it.each(['Kaia', 'XRP Ledger'])('renders a bundled logo for %s', (protocolName) => {
const { container } = render(<ProtocolIcon protocolName={protocolName} />);
expect(container.querySelector('img')?.getAttribute('src')).toBeTruthy();
});

it('renders a fallback badge for unknown protocols', () => {
render(<ProtocolIcon protocolName="Unknown Protocol" />);
expect(screen.getByText('UP')).toBeTruthy();
Expand Down
9 changes: 9 additions & 0 deletions src/components/ProtocolIcon/adichain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/components/ProtocolIcon/arc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading