Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(wallet-toolbox): derive ChainTracks from Arcade host, drop babbage defaults#306

Draft
sirdeggen wants to merge 3 commits into
mainbsv-blockchain/ts-stack:mainfrom
feat/chaintracks-arcade-derived-no-babbagebsv-blockchain/ts-stack:feat/chaintracks-arcade-derived-no-babbageCopy head branch name to clipboard
Draft

fix(wallet-toolbox): derive ChainTracks from Arcade host, drop babbage defaults#306
sirdeggen wants to merge 3 commits into
mainbsv-blockchain/ts-stack:mainfrom
feat/chaintracks-arcade-derived-no-babbagebsv-blockchain/ts-stack:feat/chaintracks-arcade-derived-no-babbageCopy head branch name to clipboard

Conversation

@sirdeggen

@sirdeggen sirdeggen commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

Removes hardcoded babbage.systems defaults from wallet-toolbox and derives service + storage endpoints per chain from the bsvblockchain.tech / bsvb.tech hosts.

ChainTracks — derived from the per-chain Arcade host (<arcade-host>/chaintracks/v1)

chain ChainTracks default
main https://arcade-v2-us-1.bsvblockchain.tech/chaintracks/v1
test https://arcade-v2-testnet-us-1.bsvblockchain.tech/chaintracks/v1
ttn https://arcade-v2-ttn-us-1.bsvblockchain.tech/chaintracks/v1
tstn $TSTN_CHAINTRACKS_URL (or ${TSTN_ARCADE_URL}/chaintracks/v1)
  • chaintracksUrl derived from arcadeDefaultUrl(chain); ${chain}net-chaintracks.babbage.systems removed (in both createDefaultWalletServicesOptions and the ChaintracksChainTracker fallback).
  • arcadeDefaultUrl('test') now returns https://arcade-v2-testnet-us-1.bsvblockchain.tech (was undefined; the endpoint exists, currently intermittently down).
  • Fiat exchange rates no longer have a default endpointchaintracksFiatExchangeRatesUrl defaults to undefined; operators must supply it (or an exchangeratesapiKey) explicitly.

Wallet storage — per-chain bsvb.tech store endpoints

New defaultStorageUrl(chain) helper replaces the main-vs-staging-storage.babbage.systems split:

chain storage default
main https://store-us-1.bsvb.tech
test https://store-testnet-us-1.bsvb.tech
ttn https://store-ttn-us-1.bsvb.tech
tstn none (private/per-deployment) — storageUrl/endpointUrl must be supplied

Setup / SetupClient throw a clear WERR_INVALID_OPERATION when a chain has no default and no explicit URL is given.

ChainTracks bulk-header CDN — cdn.projectbabbage.comchaintracks-cdn-us-1.bsvb.tech

The default bulk block-header CDN moves to https://chaintracks-cdn-us-1.bsvb.tech (root path, no /blockheaders/). Mainnet manifest (mainNetBlockHeaders.json) and header files (mainNet_*.headers, 8 MB each) verified present with matching fileHash values. Updated the create*Chaintracks option defaults, BulkFileDataManager.fromKnownSourceUrl, BulkIngestorCDNBabbage, and the static validBulkHeaderFiles sourceUrls (kept in sync with fromKnownSourceUrl).

⚠️ The new CDN does not yet serve testnet files (testNetBlockHeaders.json → 404). Testnet CDN bootstrap is unavailable until those are uploaded. The network-download test fixtures in ChaintracksFetch.test.ts / Chaintracks.test.ts (which pull testnet header files) are intentionally left pointing at the old CDN so CI stays green — move them once testnet files land on the new CDN.

Scope

Out of scope (left as-is): the cdn.projectbabbage.com header-bootstrap CDN, and explicit babbage URL fixtures inside ChaintracksClientApi.test.ts (they pass URLs directly, not via the default).

Testing

This workspace checkout could not run tsc --build or jest locally due to a pre-existing broken toolchain — @types/node is missing (process/Buffer unresolved across many untouched files) and ts-jest crashes during config setup (Cannot read properties of undefined (reading 'fileExists')). None of the tsc errors reference files changed here, and the jest crash occurs before any test runs. CI is the validation authority for this PR. Changes are small, type-consistent, and test edits are aligned with the new URLs/mocks.

🤖 Generated with Claude Code

…e defaults

ChainTracks endpoints are now derived uniformly from the per-chain Arcade host
(`<arcade-host>/chaintracks/v1`) for every public network, replacing the
hardcoded `${chain}net-chaintracks.babbage.systems` defaults:

- main: https://arcade-v2-us-1.bsvblockchain.tech/chaintracks/v1
- test: https://arcade-v2-testnet-us-1.bsvblockchain.tech/chaintracks/v1
- ttn:  https://arcade-v2-ttn-us-1.bsvblockchain.tech/chaintracks/v1
- tstn: $TSTN_CHAINTRACKS_URL (or ${TSTN_ARCADE_URL}/chaintracks/v1)

Also:
- arcadeDefaultUrl('test') returns the testnet Arcade host (was undefined; the
  endpoint exists at arcade-v2-testnet-us-1, currently intermittently down).
- ChaintracksChainTracker's default endpoint derives the same way - no babbage.
- Fiat exchange rates no longer have a default endpoint: operators must supply
  chaintracksFiatExchangeRatesUrl (or exchangeratesapiKey) explicitly.
- Updated affected unit tests and interface docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sirdeggen

Copy link
Copy Markdown
Contributor Author

Await reassurance from @galt-tr that http://arcade-v2-testnet-us-1.bsvblockchain.tech/ is the correct testnet URL

@sirdeggen
sirdeggen marked this pull request as draft July 22, 2026 21:57
Replace the main-vs-staging `storage.babbage.systems` default with per-chain
`bsvb.tech` store endpoints (mirroring the arcade host convention):

- main: https://store-us-1.bsvb.tech
- test: https://store-testnet-us-1.bsvb.tech
- ttn:  https://store-ttn-us-1.bsvb.tech
- tstn: no default (private/per-deployment) - storageUrl must be supplied explicitly

Adds a `defaultStorageUrl(chain)` helper; Setup/SetupClient throw a clear
WERR_INVALID_OPERATION when a chain has no default and no explicit URL is given.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-cdn-us-1.bsvb.tech

Swap the default bulk block-header CDN from cdn.projectbabbage.com/blockheaders to
https://chaintracks-cdn-us-1.bsvb.tech (mainnet manifest + mainNet_*.headers verified
present, matching fileHashes). Updates the create*Chaintracks option defaults,
BulkFileDataManager.fromKnownSourceUrl, BulkIngestorCDNBabbage, and the static
validBulkHeaderFiles sourceUrls (kept in sync with fromKnownSourceUrl).

Note: the new CDN does not yet serve testnet files (testNetBlockHeaders.json 404),
so testnet CDN bootstrap is unavailable until those are uploaded. Network-download
test fixtures that pull testnet files are left on the old CDN for now.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
23.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sirdeggen

Copy link
Copy Markdown
Contributor Author

TODO:

Get our CDN up for test, ttn, tstn data too.

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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.