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.
Starting the Emulatorβ
To start the emulator with default settings, use the following command:
_10flow emulator
This will start the emulator with a default configuration.
Example Outputβ
When you run the flow emulator
command, you will see output similar to the following:
_10INFO[0000] βοΈ Using service account 0xf8d6e0586b0a20c7 serviceAddress=f8d6e0586b0a20c7 ..._10INFO[0000] π± Starting Flow Emulator_10INFO[0000] π GRPC server started on 127.0.0.1:3569_10INFO[0000] π‘ HTTP server started on 127.0.0.1:8080
Initial Configurationβ
The emulator requires a configuration file (flow.json
). If you donβt already have one, create it using the flow init
command:
_10flow init
This initializes a default configuration file that the emulator will use.
Customizing the Emulatorβ
You can customize the emulator behavior by using flags. Below are some commonly used flags:
Emulator Flagsβ
Port Configuration: Change the gRPC and REST API ports:
_10flow emulator --port 9000 --rest-port 9001
Persistence: Enable persistence of state across restarts:
_10flow emulator --persist
Verbose Logging: Enable detailed logs for debugging:
_10flow emulator --verbose
For a complete list of available flags, run:
_10flow emulator --help
Learn Moreβ
To explore advanced features like snapshots, rollbacks, and debugging, visit the Flow Emulator README.