Skip to main content

Start Emulator

The Flow Emulator is a lightweight development tool that mimics the behavior of the real Flow network. It is bundled with the Flow CLI, which makes starting and configuring the emulator straightforward.

Initial Configuration

The emulator requires a configuration file (flow.json). If you don’t already have one, create it using the flow init command:


_10
flow init

This initializes a default configuration file that the emulator will use.

Starting the Emulator

To start the emulator with default settings, use the following command:


_10
flow emulator

This will start the emulator with the configuration defined in flow.json.

Example Output

When you run the flow emulator command, you will see output similar to the following:


_10
INFO[0000] ⚙️ Using service account 0xf8d6e0586b0a20c7 serviceAddress=f8d6e0586b0a20c7 ...
_10
INFO[0000] 🌱 Starting Flow Emulator
_10
INFO[0000] 🛠 GRPC server started on 127.0.0.1:3569
_10
INFO[0000] 📡 HTTP server started on 127.0.0.1:8080

Customizing the Emulator

You can customize the emulator behavior by using flags. Here are some examples:

Change the gRPC and REST API ports:


_10
flow emulator --port 9000 --rest-port 9001

Enable persistence of state across restarts:


_10
flow emulator --persist

Enable detailed logs for debugging:


_10
flow emulator --verbose

For a complete list of available flags, run:


_10
flow emulator --help

Learn More

To explore advanced features like snapshots, rollbacks, and debugging, visit the Flow Emulator README.