feat: implement bitcoin-regtest-up runtime installer#9212
Open
ulissesferreira wants to merge 4 commits into
Open
feat: implement bitcoin-regtest-up runtime installer#9212ulissesferreira wants to merge 4 commits into
ulissesferreira wants to merge 4 commits into
Conversation
fb0f940 to
87095cc
Compare
Replaces the scaffold placeholder with a foundryup-style installer that pins Bitcoin Core 30.2, downloads platform release archives, verifies SHA-256 checksums, and writes bitcoind/bitcoin-cli wrappers under node_modules/.bin.
ec59f62 to
a50a074
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a50a074. Configure here.
- Parse .yarnrc.yml as YAML for global-cache detection - Tolerate a missing package.json in the CLI option reader - Merge partial bitcoinCore overrides with pinned defaults - Propagate child termination signals as a non-zero wrapper exit
Battambang
approved these changes
Jun 22, 2026
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.

Summary
This PR is the second of two PRs splitting #8827, stacked on top of:
@metamask/bitcoin-regtest-uppackage #9211 — scaffold:feat: scaffold @metamask/bitcoin-regtest-up packageIt contains only the real implementation of the Bitcoin Core regtest runtime installer, with no unrelated monorepo changes.
What's included (delta vs scaffold PR)
src/install.ts— core Bitcoin Core download, SHA-256 checksum verification, extraction, and install logic (pinned to Bitcoin Core 30.2)src/bin/bitcoin-regtest-up.ts— CLI entry point (registered asbininpackage.json)src/index.ts— updated exportssrc/install.test.ts— Jest tests for the installer (11 tests covering download, verify, cache reuse, alternate binary layouts, cache clean)src/index.test.ts— removed (replaced by install tests)package.json— addsbinfield + version bump to 0.1.0CHANGELOG.md— changelog entry for the initial implementationREADME.md— full usage documentationjest.config.js— updated for the new test structure (relaxed coverage thresholds, CLI entry excluded)yarn.lock— updated for any new depsWhat's NOT included
No
knip.config.tschanges, no CODEOWNERS/teams.json churn (those are in the scaffold PR), no unrelated monorepo changes.Replaces
Together with #9211, this replaces #8827 with two clean, reviewable PRs based on current
origin/main.Verification
All passed ✓
Note
Low Risk
New dev/CI tooling package with checksum-verified downloads and no changes to production wallet or auth paths; main risk is incorrect binary wiring or cache behavior in local/CI environments.
Overview
Replaces the scaffold placeholder with a runtime-only Bitcoin Core installer for E2E/dev: consumers run
bitcoin-regtest-up install(or default) to download a pinned 30.2 archive per platform, verify SHA-256, extract into.metamask/cache(or~/.cache/metamaskwhen YarnenableGlobalCacheis true in parsed.yarnrc.yml), and writenode_modules/.bin/bitcoindandbitcoin-cliNode wrappers that forward args and propagate non-zero exits/signals.The
bitcoin-regtest-upCLI also supportscache clean(namespace-only),--help, and flags for cache/bin dirs, platform override, and URL/checksum overrides.package.jsonkeysbitcoinRegtestUp/ variants merge partialbitcoinCoreoverrides with defaults; missingpackage.jsonis tolerated for flag-only flows.install.tshandles alternate archive layouts (bitcoind,bitcoin-node,bitcoin+nodesubcommand), cache reuse with runnable-binary checks, stale symlink replacement, and injectable download/extract for tests. Docs, changelog,yamldependency, relaxed Jest coverage (CLI entry ignored), and broadinstall.test.tscoverage accompany thebinregistration.Reviewed by Cursor Bugbot for commit b76463a. Bugbot is set up for automated code reviews on this repo. Configure here.