Skip to content

Replace bitnodes.io (down) with Luke Dashjr API for Knots/BIP110 stats#11

Open
Kilombino wants to merge 1 commit into
Retropex:masterfrom
Kilombino:fix/bitnodes-luke-dashjr
Open

Replace bitnodes.io (down) with Luke Dashjr API for Knots/BIP110 stats#11
Kilombino wants to merge 1 commit into
Retropex:masterfrom
Kilombino:fix/bitnodes-luke-dashjr

Conversation

@Kilombino
Copy link
Copy Markdown

Problem

bitnodes.io stopped resolving (NXDOMAIN) — its API endpoint https://bitnodes.io/api/v1/snapshots/latest is unreachable. This broke two things on the dashboard:

  • Knots nodes showing 0 (no data returned)
  • BIP110 % showing NaN% (division by zero when totalBitcoinNodes = 0)

Solution

Replace the data source with Luke Dashjr's uainfo.json (https://luke.dashjr.org/programs/bitcoin/files/charts/data/uainfo.json), which provides equivalent information: per-user-agent node counts with listening and est_unreachable fields.

The backend iterates over user agent strings (the JSON keys) and sums node counts for those containing knots or bip110, the same logic as before.

Example data from Luke's API:

{
  "/Satoshi:29.3.0/Knots:20260210+bip110-v0.4.1/UASF-BIP110:0.4/": {
    "listening": 180,
    "est_unreachable": 3295
  },
  ...
}

Changes

  • backend/src/api/bitcoin/bitcoin.routes.ts — switch API source and update parsing logic
  • frontend/src/app/dashboard/dashboard.component.ts — guard bipPercentage against division by zero (defensive fix)

Known limitation

Luke's API does not provide per-node connection info, so Tor vs clearnet node breakdown is not availabletorNodes is always reported as 0. All Knots nodes are counted under clearnetNodes.

Tested on

Self-hosted instance with this patch running live: ~17,800 Knots nodes (19.6%), ~7,700 BIP110 nodes out of ~90,500 total.

bitnodes.io is no longer resolving (NXDOMAIN), breaking the Knots nodes
and BIP110 percentage displays on the dashboard.

Luke Dashjr's uainfo.json provides equivalent data: per-user-agent node
counts (listening + est_unreachable), allowing us to filter for 'knots'
and 'bip110' in the same way.

Changes:
- backend: fetch from luke.dashjr.org/programs/bitcoin/files/charts/data/uainfo.json
  instead of bitnodes.io/api/v1/snapshots/latest. Iterate over UA strings
  (keys) summing listening+est_unreachable per entry.
- frontend: guard bipPercentage calculation against division by zero when
  totalBitcoinNodes is 0 (avoids NaN% display).

Known limitation: Luke's API does not distinguish Tor vs clearnet nodes,
so torNodes is always reported as 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant