### Blockchain Stats Web App Development

I want a webapp (locally run initially), with a clear webUI, that displays the Chain, average block time (last 24h), blocks count and other averages can be added later (if it's easy to add it now, add it). Also some nice stats can be shown for increased emotional impact.

I want it to support as many chains as possible, even non EVM ones.

Something similar to this Dune board (but this one only shows for EVM chains)  
Example: [https://dune.com/jacobdcastro/avg-block-times](https://dune.com/jacobdcastro/avg-block-times)

For Stacks we have:  
[https://api.hiro.so/extended/v2/blocks/average-times](https://api.hiro.so/extended/v2/blocks/average-times)

Search and add for other known chains also, such as Bitcoin, Solana, Cardano, Near, Stacks (of course) etc, all new EVM chains (e.g. MegaETH, Monda etc) and to be able to extend it in the future.

Use publicly available fee APIs. If keys will be needed, I'll get some.

Let me start building the webapp. I'll create a structured project with a Node.js backend and a rich frontend dashboard.

### Todos

### Create project directory structure

### Write blockchain-stats/package.json

Now the main backend server:

### Write blockchain-stats/server.js

Now the frontend HTML:

### Write blockchain-stats/public/index.html

Now the CSS:

### Write blockchain-stats/public/style.css

Now the frontend JavaScript:

### Write blockchain-stats/public/app.js

Now install dependencies and test:

### Install npm dependencies

### Check Node.js version for native fetch support

Good, Node 20 has native `fetch`. Let me do a quick syntax check and then test a few APIs to validate they work:

### Check server.js for syntax errors

### Start server and check status endpoint

You have made each blockchain into a cell, with the stats, that's ok and can exist as a "Cell view" but I also want a "Table View" and a way to search/filter by name/EVM/non-EVM/Bitcoin related (Bitcoin itself, Stacks, Babylon, etc).

Good additions. I'll:
1. Add a **Table View** alongside the existing Card/Cell view with a toggle
2. Add a **search box** (filter by name in real-time)
3. Add **ecosystem filters**: EVM / Non-EVM / Bitcoin (Bitcoin, Stacks, Babylon) / Cosmos
4. Add **Babylon** to the Bitcoin ecosystem group
5. Make the cosmos fetcher reusable for multiple Cosmos-based chains

Now let's verify the syntax:

### Check JS syntax on both files

### Get detailed syntax errors for both files

### Test server.js loads without errors

### Catch and display server.js load error

The port error confirms there's already an old server running — meaning the new `server.js` code loads and parses without errors. Let me do a clean syntax check:

### Pure syntax check without executing server.js

### Pure syntax check on app.js

Both files are clean. Let me also quickly verify the HTML is well-formed:

### Verify key HTML element IDs exist

### Find PID of process using port 3000

I killed that app just now, retry

### Start server and check status endpoint

Server is up and already pre-fetching. Let me quickly validate a few chains came back with real data:

### Sample chain data from live API

### Parse and display chain results

35/42 working on first run. Let me fix the broken ones — bad RPC endpoints, NEAR params format, Polkadot, Algorand:

### Diagnose NEAR, Algorand, and Stacks API responses

### Get full block field lists and API responses

### Check Stacks and NEAR API responses directly

### Fetch Stacks and NEAR responses to files

### Fetch Stacks average-times via Node

### Test NEAR RPC with named params object

### Test alternative public RPC endpoints

### Test Fantom and Polkadot alternatives

### Test Fantom blastapi, Polkadot subscan, Monad testnet

### Test Fantom, Polkadot OnFinality, MegaETH, NEAR archival

### Test Polkadot Substrate RPC endpoints

### Test Polkadot timestamp via Substrate state storage

Now I have all the info to fix everything. Let me apply all fixes:

### Edit server.js

Now fix the NEAR fetcher (params format) and Stacks response parsing:

### Edit server.js

Fix Algorand (`ts` not `timestamp`) and Polkadot (full rewrite to Substrate RPC):

### Edit server.js

Also fix the Algorand `lastBlockAge` to use the corrected `latestTs`:

### Edit server.js

Now restart the server and verify:

### Restart server with fixes

The old server is still running. Let me kill it properly:

### Kill all node processes and restart server

### Fetch and display all chain results after warmup

39/41 working. Let me fix the last two timeouts:

### Test Cardano and Sei alternative endpoints

### Test Cardano Koios with timing

Cardano Koios main endpoint is slow; guild endpoint works at 10s. Sei works on `sei.drpc.org`. Let me fix both:

### Edit server.js

Now restart server with all fixes applied

### Wait for warmup then check chain results

### Test Sei EVM RPC alternatives

The direct test shows Sei responds in ~328ms — the earlier timeout was likely a fluke under server load. Let me restart and do a final check:

### Final server test with all fixes

### Check if server is running

### Start server fresh

### Wait for all chains to fetch then display results

### Fetch chains and display final results

**41/41 chains working.** The dashboard is live at `http://localhost:3000`.

### Todos

Here's a summary of everything that was built and fixed:

#### What's done — `http://localhost:3000`

Views

1. **Cards view** — the original grid, one card per chain with block-time gauge bar
2. **Table view** — sortable table with all chains in rows (click any column header to sort)

Filters

| Filter group   | Options                                                  |
|----------------|---------------------------------------------------------|
| **Category**    | All · L1 · L2 · Testnet                                 |
| **Ecosystem**   | All · EVM · Non-EVM · ₿ Bitcoin · Cosmos · Solana · Move VMs |
| **Search**      | Free-text name search (realtime)                        |

Chains (41/41 live)

1. **Bitcoin ecosystem**: Bitcoin, Stacks, **Babylon** (new)
2. **EVM L1s**: Ethereum, BNB, Avalanche, Fantom, Celo, Gnosis, Cronos, Moonbeam, Harmony, Aurora, Sei
3. **EVM L2s**: Polygon, Arbitrum, Optimism, Base, zkSync, Linea, Scroll, Mantle, Blast, Metis, Polygon zkEVM, Manta, Mode, Fraxtal
4. **Testnet**: Monad
5. **Non-EVM**: Solana, Cardano, NEAR, Algorand, Tezos, Hedera, Polkadot, Stellar, XRP, Cosmos Hub, Aptos, Sui

To start next time

```bash
cd blockchain-stats && npm start
```
