Skip to content

Commit

Permalink
Improve starting emulator docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chasefleming committed Dec 11, 2024
1 parent 18866f1 commit 621058a
Showing 1 changed file with 48 additions and 23 deletions.
71 changes: 48 additions & 23 deletions docs/tools/flow-cli/deployment/start-emulator.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,72 @@
---
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](../install.md), which makes starting and configuring the emulator straightforward.

```shell
## Starting the Emulator

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

```bash
flow emulator
```

⚠️ The emulator command expects configuration to be initialized. See [flow init](../flow.json/initialize-configuration.md) command.
This will start the emulator with a default configuration.

### Example Output

## Example Usage

```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
```

### 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
```

To learn more about using the Emulator, have a look at the [README of the repository](https://github.com/onflow/flow-emulator).
This initializes a default configuration file that the emulator will use.

## Customizing the Emulator

## Flags
You can customize the emulator behavior by using flags. Below are some commonly used flags:

### 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.

### Configuration
**Port Configuration**: Change the gRPC and REST API ports:

- Flag: `--config-path`
- Short Flag: `-f`
- Valid inputs: valid filename
```bash
flow emulator --port 9000 --rest-port 9001
```

**Persistence**: Enable persistence of state across restarts:

```bash
flow emulator --persist
```

Specify a filename for the configuration files, you can provide multiple configuration
files by using `-f` flag multiple times.
**Verbose Logging**: 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.
To explore advanced features like snapshots, rollbacks, and debugging, visit the [Flow Emulator README](https://github.com/onflow/flow-emulator).

0 comments on commit 621058a

Please sign in to comment.