Skip to content

feat(scripts): add check-env preflight environment validation script#1421

Open
barnazaka wants to merge 6 commits intomidnightntwrk:mainfrom
barnazaka:feat/check-env-script
Open

feat(scripts): add check-env preflight environment validation script#1421
barnazaka wants to merge 6 commits intomidnightntwrk:mainfrom
barnazaka:feat/check-env-script

Conversation

@barnazaka
Copy link
Copy Markdown

What this PR does

Adds a check-env preflight script that developers can run before
starting the Counter DApp to catch common setup issues early with
clear, actionable error messages.

Problem

New developers frequently hit silent failures because:

  • Node.js version is outdated
  • Docker isn't running
  • Compact compiler isn't installed
  • Wrong toolchain version is active

There's currently no automated way to catch these before running the DApp.

Solution

scripts/check-env.ts runs the following checks and outputs
pass/fail results with specific fix instructions:

  • Node.js version >= 22
  • npm available
  • Docker installed
  • Docker daemon is running
  • docker compose available
  • Compact compiler installed at the correct version (0.28.0)
  • Proof server reachable on port 6300 (non-blocking warning)

Run with:
npm run check-env

Testing

Manually tested on macOS with:

  • Missing Compact compiler (correctly fails with install instructions)
  • Docker not running (correctly fails with actionable message)
  • All checks passing (exits 0 and shows next step)

Documentation

The script is self-documenting via its output. No docs changes
required as this is a developer tooling addition.

Checklist

  • Code follows project coding standards
  • Script is self-contained with no new dependencies (uses npx tsx)
  • Exit codes are correct (0 = all pass, 1 = any failure)
  • Compatible with Apache-2.0 license

@barnazaka barnazaka requested review from a team as code owners March 18, 2026 01:00
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