This guide covers the day-to-day development workflow with icp-cli.
Local development follows a simple loop:
Edit code → Build → Deploy → Test → Repeat
Start the local network in the background:
icp network start -dVerify it's running:
icp network pingAfter editing your source code, deploy the changes:
icp deployThis rebuilds and redeploys all canisters. Deploy specific canisters:
icp deploy my-canisterTip: icp deploy always builds first. If you want to verify compilation before deploying, run icp build separately.
Call methods on your canister:
icp canister call my-canister method_name '(arguments)'Example:
icp canister call backend get_user '("alice")'List canisters configured in this environment:
icp canister listView the effective project configuration:
icp project showDeploy all canisters:
icp deployDeploy specific canisters:
icp deploy frontend
icp deploy backendBuild without deploying (for verification):
icp build # Build all
icp build frontend # Build specific canisterTo start fresh with a clean network:
# Stop the current network
icp network stop
# Start a new network (previous state is discarded)
icp network start -dThen redeploy your canisters:
icp deployCheck network status:
icp network statusView network details as JSON:
icp network status --jsonStop the network when done:
icp network stopBuild fails with "command not found"
Ensure your language toolchain is installed and in PATH:
- Rust:
rustup target add wasm32-unknown-unknown - Motoko:
mops toolchain init
Network connection fails
Check if the network is running:
icp network pingIf not responding, restart:
icp network stop
icp network start -dDeployment fails
- Verify the build succeeded:
icp build - Check network health:
icp network ping
- Deploying to Mainnet — Go live with your canisters