w3m dev
Start the local development environment. Launches a local Ethereum node, compiles and deploys contracts, runs codegen, and starts the frontend dev server.
w3m devDoes not require authentication.
Options
| Option | Default | Description |
|---|---|---|
-p, --port <port> | 3000 | Frontend dev server port |
--no-anvil | Skip starting the local Anvil chain | |
--skip-frontend | Skip starting the frontend dev server |
What It Does
Load Configuration
Loads kit.config.ts from the current directory.
Start Anvil
Starts a local Anvil instance on http://127.0.0.1:8545. Skipped if --no-anvil is passed.
Compile Contracts
Runs forge build in the contracts/ directory.
Validate Environment Variables
Scans the deploy script for required environment variables (vm.envUint, vm.envAddress, etc.). Known variables like DEPLOYER_PRIVATE_KEY are auto-provided using the default Anvil account. If your deploy script requires custom variables that are not set, you are told exactly which ones to add before deployment is attempted.
Deploy to Local Chain
Deploys contracts to the local Anvil chain. The default DEPLOYER_PRIVATE_KEY is auto-provided (Anvil account #0). If your deploy script requires additional environment variables, set them in a .env file or export them in your shell.
Run Codegen
Generates TypeScript bindings, ABI constants, and address registries from the compiled contract artifacts.
Start Frontend Dev Server
Starts the frontend development server:
- Next.js: Runs
npx next dev -p <port>in theweb/directory - Vite: Runs
npx vite --port <port>in theweb/directory - None: If no frontend is configured, keeps Anvil running until Ctrl+C
Once running, your frontend is at http://localhost:3000 and your local chain is at http://127.0.0.1:8545.
Process Lifecycle
All child processes (Anvil, frontend server) are cleaned up when you press Ctrl+C.
Requires Foundry for Anvil and contract compilation. Install with:
curl -L https://foundry.paradigm.xyz | bash
foundryupExamples
# Start with defaults (port 3000, Anvil on 8545)
w3m dev
# Use a custom port for the frontend
w3m dev --port 5173
# Skip Anvil (e.g., if you run your own node)
w3m dev --no-anvil
# Contracts only, no frontend server
w3m dev --skip-frontend