Skip to content

feat: implement solana-test-validator-up runtime installer#9210

Open
ulissesferreira wants to merge 4 commits into
mainfrom
add-solana-test-validator-up-package-impl
Open

feat: implement solana-test-validator-up runtime installer#9210
ulissesferreira wants to merge 4 commits into
mainfrom
add-solana-test-validator-up-package-impl

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR is the second of two PRs splitting #8826, stacked on top of:

It contains only the real implementation of the Solana/Agave test-validator runtime installer, with no unrelated monorepo changes.

What's included (delta vs scaffold PR)

  • src/install.ts — core Agave/solana-test-validator download, checksum verification, extraction, and install logic
  • src/bin/solana-test-validator-up.ts — CLI entry point (registered as bin in package.json)
  • src/index.ts — updated exports
  • src/install.test.ts — Jest tests for the installer
  • src/index.test.ts — removed (replaced by install tests)
  • package.json — adds bin field + version bump
  • CHANGELOG.md — changelog entry for the initial implementation
  • README.md — full usage documentation
  • jest.config.js — updated for the new test structure
  • yarn.lock — updated for any new deps

What's NOT included

No knip.config.ts changes, no CODEOWNERS/teams.json churn (those are in the scaffold PR), no unrelated monorepo changes.

Replaces

Together with #9209, this replaces #8826 with two clean, reviewable PRs based on current origin/main.

Verification

yarn workspace @metamask/solana-test-validator-up run build
yarn workspace @metamask/solana-test-validator-up run test
yarn eslint packages/solana-test-validator-up
yarn constraints
yarn workspace @metamask/solana-test-validator-up run changelog:validate
yarn dedupe --check

All passed ✓


Note

Low Risk
New dev/CI tooling package with checksum-verified downloads and tests; no changes to wallet, auth, or production runtime paths.

Overview
Replaces the scaffold placeholder with a runtime-only installer modeled on @metamask/foundryup: it downloads a pinned Agave v3.1.14 release per platform, verifies SHA-256 checksums, extracts the archive into the MetaMask cache, and writes solana-test-validator and solana wrappers under node_modules/.bin. The harness is expected to start the validator and seed accounts; this package does not run Docker or a node.

Adds solana-test-validator-up CLI (install, default install, cache clean, --help) and exports the install API from src/index.ts. Cache location follows Yarn: YAML-parsed .yarnrc.yml enableGlobalCache selects ~/.cache/metamask vs repo .metamask/cache. Options merge from package.json (solanaTestValidatorUp and aliases), CLI flags, and defaults; partial release overrides shallow-merge platform maps instead of replacing pinned defaults. Missing package.json yields empty config so flag-only commands work.

Generated bin wrappers use spawnSync and exit non-zero when the child exits on a signal. Adds yaml dependency, broad install.test.ts, README/changelog, relaxed Jest coverage thresholds, and drops the greeter stub test.

Reviewed by Cursor Bugbot for commit b133f26. Bugbot is set up for automated code reviews on this repo. Configure here.

@ulissesferreira ulissesferreira requested review from a team as code owners June 19, 2026 13:03
Comment thread packages/solana-test-validator-up/src/install.ts Outdated
Comment thread packages/solana-test-validator-up/src/install.ts Outdated
Base automatically changed from add-solana-test-validator-up-package-scaffold to main June 22, 2026 09:25
@ulissesferreira ulissesferreira force-pushed the add-solana-test-validator-up-package-impl branch from ae45215 to 1be60e9 Compare June 22, 2026 10:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ 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 1be60e9. Configure here.

Comment thread packages/solana-test-validator-up/src/install.ts
- Parse .yarnrc.yml as YAML for global-cache detection
- Tolerate a missing package.json in the CLI option reader
- Merge partial release overrides with pinned defaults
- Propagate child termination signals as a non-zero wrapper exit
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.

1 participant