Skip to content

Commit e28d351

Browse files
authored
Improve starting emulator docs (#1038)
* Improve starting emulator docs * Move config to above running --------- Co-authored-by: Chase Fleming <[email protected]>
1 parent 18866f1 commit e28d351

File tree

1 file changed

+47
-24
lines changed

1 file changed

+47
-24
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,70 @@
11
---
22
title: Start Emulator
3-
description: How to start Flow emulator from the command line
3+
description: How to start the Flow Emulator from the command line
44
sidebar_position: 1
55
---
66

7-
The Flow CLI provides a command to start an emulator.
8-
The Flow Emulator is a lightweight tool that emulates the behaviour of the real Flow network.
7+
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.
98

10-
```shell
11-
flow emulator
9+
## Initial Configuration
10+
11+
The emulator requires a configuration file (`flow.json`). If you don’t already have one, create it using the `flow init` command:
12+
13+
```bash
14+
flow init
1215
```
1316

14-
⚠️ The emulator command expects configuration to be initialized. See [flow init](../flow.json/initialize-configuration.md) command.
17+
This initializes a default configuration file that the emulator will use.
18+
19+
## Starting the Emulator
20+
21+
To start the emulator with default settings, use the following command:
22+
23+
```bash
24+
flow emulator
25+
```
1526

27+
This will start the emulator with the configuration defined in `flow.json`.
1628

17-
## Example Usage
29+
### Example Output
1830

19-
```shell
20-
> flow emulator
31+
When you run the `flow emulator` command, you will see output similar to the following:
2132

33+
```bash
2234
INFO[0000] ⚙️ Using service account 0xf8d6e0586b0a20c7 serviceAddress=f8d6e0586b0a20c7 ...
23-
...
35+
INFO[0000] 🌱 Starting Flow Emulator
36+
INFO[0000] 🛠 GRPC server started on 127.0.0.1:3569
37+
INFO[0000] 📡 HTTP server started on 127.0.0.1:8080
2438
```
2539

26-
To learn more about using the Emulator, have a look at the [README of the repository](https://github.com/onflow/flow-emulator).
40+
## Customizing the Emulator
2741

28-
## Flags
42+
You can customize the emulator behavior by using flags. Here are some examples:
2943

30-
### Emulator Flags
31-
You can specify any [emulator flags found here](https://github.com/onflow/flow-emulator#configuration) and they will be applied to the emulator service.
44+
Change the gRPC and REST API ports:
3245

33-
### Configuration
46+
```bash
47+
flow emulator --port 9000 --rest-port 9001
48+
```
49+
50+
Enable persistence of state across restarts:
3451

35-
- Flag: `--config-path`
36-
- Short Flag: `-f`
37-
- Valid inputs: valid filename
52+
```bash
53+
flow emulator --persist
54+
```
3855

39-
Specify a filename for the configuration files, you can provide multiple configuration
40-
files by using `-f` flag multiple times.
56+
Enable detailed logs for debugging:
4157

42-
### Version Check
58+
```bash
59+
flow emulator --verbose
60+
```
61+
62+
For a complete list of available flags, run:
63+
64+
```bash
65+
flow emulator --help
66+
```
4367

44-
- Flag: `--skip-version-check`
45-
- Default: `false`
68+
## Learn More
4669

47-
Skip version check during start up to speed up process for slow connections.
70+
To explore advanced features like snapshots, rollbacks, and debugging, visit the [Flow Emulator README](https://github.com/onflow/flow-emulator).

0 commit comments

Comments
 (0)