diff --git a/docs/tools/flow-cli/deployment/start-emulator.md b/docs/tools/flow-cli/deployment/start-emulator.md index bf299dd3a1..e5e55ff15b 100644 --- a/docs/tools/flow-cli/deployment/start-emulator.md +++ b/docs/tools/flow-cli/deployment/start-emulator.md @@ -1,47 +1,70 @@ --- title: Start Emulator -description: How to start Flow emulator from the command line +description: How to start the Flow Emulator from the command line sidebar_position: 1 --- -The Flow CLI provides a command to start an emulator. -The Flow Emulator is a lightweight tool that emulates the behaviour of the real Flow network. +The Flow Emulator is a lightweight development tool that mimics the behavior of the real Flow network. It is bundled with the [Flow CLI](https://docs.onflow.org/flow-cli/), which makes starting and configuring the emulator straightforward. -```shell -flow emulator +## Initial Configuration + +The emulator requires a configuration file (`flow.json`). If you don’t already have one, create it using the `flow init` command: + +```bash +flow init ``` -⚠️ The emulator command expects configuration to be initialized. See [flow init](../flow.json/initialize-configuration.md) command. +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: + +```bash +flow emulator +``` +This will start the emulator with the configuration defined in `flow.json`. -## Example Usage +### Example Output -```shell -> flow emulator +When you run the `flow emulator` command, you will see output similar to the following: +```bash INFO[0000] ⚙️ Using service account 0xf8d6e0586b0a20c7 serviceAddress=f8d6e0586b0a20c7 ... -... +INFO[0000] 🌱 Starting Flow Emulator +INFO[0000] 🛠 GRPC server started on 127.0.0.1:3569 +INFO[0000] 📡 HTTP server started on 127.0.0.1:8080 ``` -To learn more about using the Emulator, have a look at the [README of the repository](https://github.com/onflow/flow-emulator). +## Customizing the Emulator -## Flags +You can customize the emulator behavior by using flags. Here are some examples: -### Emulator Flags -You can specify any [emulator flags found here](https://github.com/onflow/flow-emulator#configuration) and they will be applied to the emulator service. +Change the gRPC and REST API ports: -### Configuration +```bash +flow emulator --port 9000 --rest-port 9001 +``` + +Enable persistence of state across restarts: -- Flag: `--config-path` -- Short Flag: `-f` -- Valid inputs: valid filename +```bash +flow emulator --persist +``` -Specify a filename for the configuration files, you can provide multiple configuration -files by using `-f` flag multiple times. +Enable detailed logs for debugging: -### Version Check +```bash +flow emulator --verbose +``` + +For a complete list of available flags, run: + +```bash +flow emulator --help +``` -- Flag: `--skip-version-check` -- Default: `false` +## Learn More -Skip version check during start up to speed up process for slow connections. \ No newline at end of file +To explore advanced features like snapshots, rollbacks, and debugging, visit the [Flow Emulator README](https://github.com/onflow/flow-emulator). \ No newline at end of file