nightforge
v1.0.0
Published
A comprehensive development tool for Midnight blockchain - like Hardhat but for Midnight
Downloads
249
Maintainers
Readme
Nightforge 🔨
Nightforge is a development environment to compile, deploy, and operate Midnight contracts.
It gives Midnight developers a streamlined workflow with built-in project scaffolding, wallet lifecycle tools, proof server orchestration, and deployment.
📦 Installation
Local install
npm install nightforgeRun with:
npx nightforge --help🚀 Quick Start
# 1) Create project
npx nightforge init my-midnight-app
# 2) Enter project
cd my-midnight-app
# 3) Compile contract
npx nightforge compile
# 4) Start wallet sync service
npx nightforge sync
# 5) In another terminal, check synced balance
npx nightforge wallet balance
# 6) Deploy using synced state
npx nightforge deploy example --network preprod🧠 Auto Mode (Recommended)
deploy --auto can orchestrate the full flow:
- Auto-create wallet if missing
- Wait for tNIGHT funding
- Convert/register to DUST automatically
- Wait for proof server status file readiness
- Deploy contract
npx nightforge deploy --auto --network preprodUse a remote proof server directly:
npx nightforge deploy example --auto --remote http://YOUR-PROOF-HOST:6300Use legacy non-sync wallet path:
npx nightforge deploy example --legacy🗂️ Core Runtime Files
Nightforge uses local state files in your project root:
wallet.json→ persisted wallet seed/address/networkproof-server-status.json→ proof server running/ready URL statedeployment.json→ deployment metadata output
📚 Commands
npx nightforge init <project-name> # Create project
npx nightforge compile # Compile contracts
npx nightforge sync --init # Create walletsync files (.env example + config)
npx nightforge sync # Start walletsync server (walletsync-first flow)
npx nightforge sync --status # Show walletsync config/env status
npx nightforge sync --balance [alias] # Read walletsync snapshot balance
npx nightforge sync --port 9999 # Run sync server on custom port (persists in config)
npx nightforge wallet create # Create wallet
npx nightforge wallet restore # Restore wallet
npx nightforge wallet balance # Check balance
npx nightforge wallet dust # Convert to DUST
npx nightforge proof-server start # Start proof server
npx nightforge ps # Shorthand for proof-server
npx nightforge deploy <contract> # Deploy contract
npx nightforge deploy <contract> --remote # Deploy via explicit remote proof server URL
npx nightforge deploy <contract> --legacy # Deploy using legacy non-sync wallet checks
npx nightforge deploy <contract> --auto # Auto deploy (with wallet/DUST/server wait)
npx nightforge clean # Remove artifactsDetailed guides:
- Docs index
- Contributing guide
- Changelog
- Init guide
- Compile guide
- Sync guide
- Wallet guide
- Proof-server guide
- PS alias guide
- Deploy guide
- Clean guide
