A free, serverless name+page indexer for BSVKey. A scheduled GitHub Action scans the
on-chain CHOST name registry and each owner's published pages, then publishes a static
docs/names.json which GitHub Pages serves over a CDN:
{ "schema": "bsvkey-names/2", "names": {
"myname": { "owner": "1Addr…", "txid": "<name-claim tx>", "page": "<page tx or null>" } } }Because each name carries its page transaction id, BSVKey resolves a site in one
fetch (name → page tx → HTML) instead of scanning a wallet's whole history. It still
falls back to a trustless on-chain scan if the index is unavailable.
No server, no dependencies (Node 18+ built-in fetch).
scripts/build-index.js one-shot scanner → writes docs/names.json
.github/workflows/index.yml cron (every 15 min) + manual run; commits names.json
docs/names.json the published index (ships pre-built with your 53 names)
docs/index.html a tiny status/lookup page
- Create a new GitHub repo and push these files to it (root of the repo).
- Settings → Pages → Build and deployment → Source: Deploy from a branch,
Branch: main, Folder: /docs → Save.
Your index is now at:
https://<your-user>.github.io/<repo>/names.json(and a status page athttps://<your-user>.github.io/<repo>/). - Settings → Actions → General → Workflow permissions → Read and write (so the
Action can commit the refreshed
names.json). - (Optional, recommended) Settings → Secrets and variables → Actions → New secret
named
WOC_API_KEYwith a free WhatsOnChain API key — makes scans faster and avoids rate limits as the registry grows. - The Action runs every ~15 min; trigger it now from the Actions tab → Build BSVKey name index → Run workflow.
In BSVKey's index.html, set near the top of the script:
const NAME_INDEX_JSON = 'https://<your-user>.github.io/<repo>/names.json'Redeploy the site. Name resolution + "Show my assets" now use the snapshot instantly, and fall back to the on-chain scan automatically if the snapshot can't be reached.
- Freshness = the cron cadence (~15 min). A brand-new claim shows up on the next run.
- Scale: one
names.jsonis fine for tens of thousands of names. Beyond that, shard by first character or move to the always-onbsvkey-indexer(dynamic API). Thename → ownercontract is identical either way. - Keep
REGISTRY_ADDRESS(in the workflow env) identical to the app's, or they'll disagree. - The scan is incremental —
actions/cacherestores the tx cache between runs, so only new registry transactions are fetched.