Skip to content

Commit 1a9ada0

Browse files
authored
Merge pull request #1483 from onflow/cf/emulator-docs-improvement
Emulator Docs Improvement
2 parents 54648b7 + 2f77d25 commit 1a9ada0

File tree

1 file changed

+42
-11
lines changed

1 file changed

+42
-11
lines changed

docs/build/tools/emulator/index.md

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,54 @@
11
---
22
title: Flow Emulator
3-
description: A development tool that looks, acts and talks like Flow
3+
description: Local Flow network for development and testing
44
sidebar_position: 3
55
---
66

7-
The Flow Emulator is a lightweight tool that emulates the behaviour of the real Flow network.
7+
The Flow Emulator is a lightweight tool that emulates the behavior of the real Flow network for local development and testing.
88

9-
The emulator exposes a gRPC server that implements the Flow Access API,
10-
which is designed to have near feature parity with the real network API.
9+
## Installation
1110

12-
## Running the emulator with the Flow CLI
11+
The emulator is included with the [Flow CLI](../flow-cli/index.md). Follow the [installation guide](../flow-cli/install.md) to get started.
1312

14-
The emulator is bundled with the [Flow CLI](../flow-cli/index.md), a command-line interface for working with Flow.
13+
## Quick Start
1514

16-
### Installation
15+
First, create a `flow.json` configuration file:
1716

18-
Follow [these steps](../flow-cli/install.md) to install the Flow CLI on macOS, Linux, and Windows.
17+
```bash
18+
flow init --config-only
19+
```
1920

20-
## Usage
21+
Then start the Flow Emulator:
2122

22-
To learn more about using the Emulator,
23-
have a look at [the README of the repository](https://github.com/onflow/flow-emulator/#starting-the-server).
23+
```bash
24+
flow emulator
25+
```
26+
27+
This starts a local Flow network with:
28+
- gRPC server on port `3569`
29+
- REST API on `http://localhost:8888`
30+
- Admin API on port `8080`
31+
32+
## Common Options
33+
34+
```bash
35+
# Start with verbose logging
36+
flow emulator --verbose
37+
38+
# Set custom block time (e.g., 1 second between blocks)
39+
flow emulator --block-time 1s
40+
41+
# Persist state between restarts
42+
flow emulator --persist
43+
```
44+
45+
For all available options, see the [CLI commands overview](../flow-cli/index.md).
46+
47+
## Debugging & Testing
48+
49+
- **Code Coverage**: Add `--coverage-reporting` flag and visit `http://localhost:8080/emulator/codeCoverage`
50+
- **Debugging**: Use `#debugger()` pragma in Cadence code for breakpoints
51+
52+
## Additional Resources
53+
54+
For advanced configuration options, see the [Flow Emulator repository](https://github.com/onflow/flow-emulator/).

0 commit comments

Comments
 (0)