TypeScript regression tests (run via tsx) against a local clone of mainnet state, sudo-upgraded
to the runtime built from this monorepo. CI runs the smoke test plus
test:clone-regressions in runtime-checks.yml after every PR runtime
upgrade.
scripts/clone-mainnet.shcreates or refreshes a patched mainnet clone chainspec underclones/(gitignored).scripts/start-local-clone.shstarts a local node atws://127.0.0.1:9944.js-tests/tests/clone-smoke-test.tsconfirms the websocket endpoint is usable.js-tests/scripts/update-runtime-with-alice.tssudo-upgrades the clone using the wasm fromtarget/release/wbuild/node-subtensor-runtime/(built from the monorepo root).npm run test:clone-regressionsruns focused regressions against the upgraded clone.scripts/stop-local-clone.shstops the node.
Full contributor walkthrough: docs/internals/mainnet-clone.mdx.
From the monorepo root:
cargo build --release -p node-subtensor
./clones/scripts/clone-mainnet.sh
./clones/scripts/start-local-clone.sh # leave running; use another terminal
cd clones/js-tests
npm ci
npm run runtime:update:alice
npm test # smoke
npm run test:clone-regressions # full local clone suite
# from repo root when done:
./clones/scripts/stop-local-clone.shThe runtime upgrade script reads wasm from:
target/release/wbuild/node-subtensor-runtime/node_subtensor_runtime.compact.compressed.wasm
Override with RUNTIME_WASM_PATH if needed.
| Script | Purpose |
|---|---|
npm test |
Connectivity smoke test |
npm run test:clone-regressions |
Curated regressions for the upgraded local clone (CI) |
npm run test:<name> |
Individual tests; see package.json for the full list |
Tests defaulting to ws://127.0.0.1:9944 are clone-local. Scripts prefixed
with testnet- or test:balancer-devnet-* target live networks and are
manual-only.
- Clone data and chainspec files live under
clones/(gitignored). - Keep new tests focused; prefer shared helpers in
js-tests/lib/over copy-pasting chain plumbing. - Tests are TypeScript executed with
tsx;npm run typecheckrunstsc --noEmitover the suite.