Replace bitnodes.io (down) with Luke Dashjr API for Knots/BIP110 stats#11
Open
Kilombino wants to merge 1 commit into
Open
Replace bitnodes.io (down) with Luke Dashjr API for Knots/BIP110 stats#11Kilombino wants to merge 1 commit into
Kilombino wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
bitnodes.iostopped resolving (NXDOMAIN) — its API endpointhttps://bitnodes.io/api/v1/snapshots/latestis unreachable. This broke two things on the dashboard: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 withlisteningandest_unreachablefields.The backend iterates over user agent strings (the JSON keys) and sums node counts for those containing
knotsorbip110, 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 logicfrontend/src/app/dashboard/dashboard.component.ts— guardbipPercentageagainst 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 available —
torNodesis always reported as0. All Knots nodes are counted underclearnetNodes.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.