Migrate regtest usage off nigiri (in-house Node CLI)#7
Conversation
arkade-regtest dropped nigiri/chopsticks/esplora for an in-house Docker Compose stack driven by a zero-dependency Node CLI (regtest.mjs). This migrates the solver's integration test harness onto it. - Add arkade-regtest as a git submodule at regtest/ (pinned to master; NOT bumped to the unmerged denigiri-regtest branch). - Makefile: setup/teardown-test-env now run `node regtest/regtest.mjs start|clean` instead of `nigiri start` / `nigiri stop --delete`; the arkd-funding loop uses `node regtest/regtest.mjs faucet ... --confirm`. - test/docker-compose.yml: ARKD_ESPLORA_URL chopsticks:3000 -> mempool_web/api; external network nigiri -> arkade-regtest_default. - test/e2e/utils_test.go: faucet() invokes the regtest CLI (resolved by repo-root-relative path) with --confirm so funding txs are mined. - CI (integration.yaml): checkout submodules recursively, setup-node, `node regtest/regtest.mjs start|clean` in place of the nigiri action. - README: document submodule init, new commands, network, and mining note.
There was a problem hiding this comment.
Review: Migrate regtest usage off nigiri — ✅ APPROVE
Clean infrastructure migration. No protocol-critical code touched — this only changes the test harness (CI, Makefile, docker-compose, test utilities). No VTXO, signing, forfeit, round, or exit path changes.
Verified correct
- Network name:
arkade-regtest_defaultmatches thename: arkade-regtestproject name indocker/compose.base.yml. ✅ - Esplora URL:
http://mempool_web/apimatches themempool_webservice incompose.base.ymland the pattern used byarkdandfulmineincompose.ark.yml. ✅ - CI workflow ordering: setup-node before start, teardown in
if: always()steps, dependent stack torn down before base stack. ✅ submodules: recursiveon checkout — correct for the new git submodule. ✅repoRoot()viaruntime.Caller(0)— standard Go pattern, never fails for compiled test code. ✅- Cross-repo impact: None. This PR doesn't change any public API. Other repos (emulator, coinflip, bancod, etc.) still use their own nigiri references independently — they'll migrate separately.
Finding — --confirm is a no-op (low severity)
Makefile:101, test/e2e/utils_test.go:170: Both pass --confirm to regtest.mjs faucet, and the Go code comments say "--confirm mines a block immediately after the send".
However, regtest.mjs's argument parser (parseArgs, line 66) does not recognize --confirm — it falls through to opts.positional.push(a) where it's silently ignored. The faucet() function in lib/chain.mjs:86-93 always calls mine(1) unconditionally.
Net effect: The code works correctly — faucet always confirms. But the --confirm flag does nothing, and the comments claiming it controls mining behavior are misleading. Consider either:
- Dropping
--confirmand updating comments to reflect thatfaucetalways mines, or - Adding
--confirmsupport toregtest.mjsif you want opt-in mining in the future.
Not blocking — the behavior is correct as-is.
Note for merge
PR is self-described as blocked on ArkLabsHQ/arkade-regtest#27. The submodule pin (cd47313) must be bumped after that merges. The checklist in the PR description covers this.
🤖 Reviewed by Arkana
Temporary: points at unmerged ArkLabsHQ/arkade-regtest#27 (commit 20c0851) so CI can find regtest.mjs and run integration. Re-point to master once #27 merges.
solverd-arkd exited fatally ('failed to connect to wallet ... connection refused') because it started before solverd-arkd-wallet was listening, then crash-looped — and docker-run's fixed 'sleep 15' ran 'arkd wallet create' while it was still restarting. Poll for arkd readiness instead. Also start only the arkade-regtest base profile (solver runs its own arkd stack) with AUTOMINE_INTERVAL=0.
Old nbxplorer 2.5.30 crash-loops against the base stack's Bitcoin Core 31 (indexer dies -> arkd-wallet can't init -> arkd fatal: failed to connect to wallet). Align with arkade-regtest's working base (arkd/arkd-wallet v0.9.6, nbxplorer 2.6.7).
There was a problem hiding this comment.
Incremental review (commits 3c9e2ea..027ba72) — ✅ APPROVE
Three new commits since my last review. All infrastructure-only — no protocol-critical changes.
1. Submodule bump to denigiri-regtest (3c9e2ea)
Temporary pin to 20c0851 on the unmerged branch so CI can find regtest.mjs. Fine — this was flagged as a prerequisite in my first review. Remember to re-point to master after ArkLabsHQ/arkade-regtest#27 merges.
2. Startup race fix (a6685b8) ✅
Replaces the fragile sleep 15 with a readiness poll (docker exec solverd-arkd arkd wallet status). Good fix — matches the crash-loop scenario described in the commit message (arkd fatals if arkd-wallet isn't ready).
Also adds REGTEST_PROFILES=base AUTOMINE_INTERVAL=0 to both CI and setup-test-env. Correct — solver runs its own arkd, doesn't need arkade-regtest's ark profile, and wants explicit mining.
Minor nit — Makefile:97-100: The poll loop has no failure path. If all 90 iterations (180s) expire without arkd becoming ready, the script silently falls through to wallet create, which will also fail. Consider adding a timeout exit:
@for i in $$(seq 1 90); do \
docker exec solverd-arkd arkd wallet status >/dev/null 2>&1 && { echo "solverd-arkd ready"; break; }; \
[ $$i -eq 90 ] && { echo "ERROR: solverd-arkd not ready after 180s"; exit 1; }; \
sleep 2; \
doneNot blocking — wallet create failing is a visible enough signal in practice.
3. Version bumps (027ba72) ✅
- nbxplorer
2.5.30→2.6.7— needed for Bitcoin Core 31 compatibility - arkd/arkd-wallet
v0.9.3→v0.9.6— aligns with arkade-regtest's base stack
Correct versions. No config schema changes between these versions that would require env var updates.
Previous finding status
My --confirm no-op finding from the first review still applies — low severity, not blocking.
🤖 Reviewed by Arkana
There was a problem hiding this comment.
Incremental review (commits 3c9e2ea..027ba72) — ✅ APPROVE
Three new commits since my last review. All infrastructure-only — no protocol-critical changes.
1. Submodule bump to denigiri-regtest (3c9e2ea)
Temporary pin to 20c0851 on the unmerged branch so CI can find regtest.mjs. Fine — this was flagged as a prerequisite in my first review. Remember to re-point to master after ArkLabsHQ/arkade-regtest#27 merges.
2. Startup race fix (a6685b8) ✅
Replaces the fragile sleep 15 with a readiness poll (docker exec solverd-arkd arkd wallet status). Good fix — matches the crash-loop scenario described in the commit message (arkd fatals if arkd-wallet isn't ready).
Also adds REGTEST_PROFILES=base AUTOMINE_INTERVAL=0 to both CI and setup-test-env. Correct — solver runs its own arkd, doesn't need arkade-regtest's ark profile, and wants explicit mining.
Minor nit — Makefile:97-100: The poll loop has no failure path. If all 90 iterations (180s) expire without arkd becoming ready, the script silently falls through to wallet create, which will also fail. Consider adding a timeout exit:
@for i in $$(seq 1 90); do \
docker exec solverd-arkd arkd wallet status >/dev/null 2>&1 && { echo "solverd-arkd ready"; break; }; \
[ $$i -eq 90 ] && { echo "ERROR: solverd-arkd not ready after 180s"; exit 1; }; \
sleep 2; \
doneNot blocking — wallet create failing is a visible enough signal in practice.
3. Version bumps (027ba72) ✅
- nbxplorer
2.5.30→2.6.7— needed for Bitcoin Core 31 compatibility - arkd/arkd-wallet
v0.9.3→v0.9.6— aligns with arkade-regtest's base stack
Correct versions. No config schema changes between these versions that would require env var updates.
Previous finding status
My --confirm no-op finding from the first review still applies — low severity, not blocking.
🤖 Reviewed by Arkana
Summary
arkade-regtestwas rewritten to drop nigiri / chopsticks / esplora in favour of an in-house Docker Compose stack (Bitcoin Core + Fulcrum + mempool + NBXplorer + arkd + …) driven by a zero-dependency Node CLI (regtest.mjs). This migrates the solver's integration test harness off nigiri and onto it.arkade-regtestas a git submodule atregtest/, pinned tomaster. NOT bumped to the unmergeddenigiri-regtestbranch (see "Blocked by" below).setup-test-env/teardown-test-envnow runnode regtest/regtest.mjs start/cleaninstead ofnigiri start/nigiri stop --delete. The arkd-funding loop usesnode regtest/regtest.mjs faucet <addr> <btc> --confirm.test/docker-compose.yml:ARKD_ESPLORA_URL:http://chopsticks:3000→http://mempool_web/api(esplora REST moved under mempool's/api).nigiri→arkade-regtest_default(the default network of thearkade-regtestcompose project).test/e2e/utils_test.go:faucet()now invokes the regtest CLI with--confirm. The CLI path is resolved repo-root-relative (viaruntime.Caller) so it works regardless ofgo test's working directory (which istest/e2e, not the repo root)..github/workflows/integration.yaml): replace thevulpemventures/nigiri-github-actionstep withactions/setup-node+node regtest/regtest.mjs start;actions/checkoutnow usessubmodules: recursive; added a teardownnode regtest/regtest.mjs clean.⚠ Behavioral change — mining
nigiri auto-mined and
nigiri faucetconfirmed immediately. arkade-regtest'sfaucetspends from the Bitcoin Core node wallet and does NOT mine by default —--confirmmines one block right after the send to preserve the old confirm-on-faucet behavior. A background auto-miner also mines everyAUTOMINE_INTERVALseconds (default 600;0disables). Every place that faucets and then waits for a confirmation now passes--confirm(Makefile funding loop +faucet()inutils_test.go).Consumption pattern (note — diverges from the canonical submodule consumer)
The solver does not drive arkade-regtest end-to-end. It runs its own
test/docker-compose.yml(its ownsolverd-arkd/solverd-arkd-wallet/solverd-nbxplorer/solverd-emulatorstack) and previously attached to nigiri's external network to reach nigiri's bitcoin node + chopsticks esplora, funding vianigiri faucet. So arkade-regtest here only provides the base chain + indexer/explorer + faucet, not arkd. Consequently:solverd-arkd(the brief'sark→arkdrename applies to arkade-regtest's own arkd container, not the solver's separately-named one), sodocker exec solverd-arkd …is left as-is.ARKD_*tuning, image pins, and zero-fee settings are kept. There were noNIGIRI_*,BITCOIN_LOW_FEE, orARK_CONTAINERvars in this repo to remove.Open questions / manual follow-ups
arkade-regtestcompose project's default network isarkade-regtest_default(derived from thename: arkade-regtestindocker/compose.base.yml). Confirm once #27 is merged — if the project name or network differs, updatenetworks.default.nameintest/docker-compose.yml.node regtest/regtest.mjs startbrings up the base stack. arkade-regtest also runs the solver as its ownsolverprofile; this PR deliberately does not use that — the solver repo keeps building/running its own solverd for the e2e tests. If only a subset of base services is needed, considerREGTEST_PROFILES./apiand the bitcoin node are reachable from thesolverd-arkdcontainer over the shared network in CI once the real stack is up.Verify after ArkLabsHQ/arkade-regtest#27 merges
The submodule is pinned to
arkade-regtestmaster, which does not yet containregtest.mjs. Full integration tests cannot run until #27 merges and the submodule is bumped. Do not expect a green integration run before then.git -C regtest fetch && git -C regtest checkout origin/master && git add regtestregtest/regtest.mjsexists andnode regtest/regtest.mjs startboots the stackarkade-regtest_default(open question Update documentation to use "Arkade" terminology consistently #1)make setup-test-env && make integrationtest && make teardown-test-envlocallyBlocked by ArkLabsHQ/arkade-regtest#27