Flow Emulator
The Flow Emulator is a lightweight tool that emulates the behavior of the real Flow network for local development and testing.
Installation
The emulator is included with the Flow CLI. Follow the installation guide to get started.
Quick Start
First, create a flow.json
configuration file:
_10flow init --config-only
Then start the Flow Emulator:
_10flow emulator
This starts a local Flow network with:
- gRPC server on port
3569
- REST API on
http://localhost:8888
- Admin API on port
8080
Common Options
_10# Start with verbose logging_10flow emulator --verbose_10_10# Set custom block time (e.g., 1 second between blocks)_10flow emulator --block-time 1s_10_10# Persist state between restarts_10flow emulator --persist
For all available options, see the CLI commands overview.
Debugging & Testing
- Code Coverage: Add
--coverage-reporting
flag and visithttp://localhost:8080/emulator/codeCoverage
- Debugging: Use
#debugger()
pragma in Cadence code for breakpoints
Additional Resources
For advanced configuration options, see the Flow Emulator repository.