You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The moonwall `init` command walks you through a step-by-step process to setting up your `moonwall.config.json` file.
3
+
The `init` command guides you through a step-by-step process to create a configuration file for Moonwall. This command will set up a new `moonwall.config.json` file in your current directory—provided one does not already exist.
4
4
5
-
The command takes no parameters but you'll be asked for the following to complete the setup of your `moonwall.config.json` file. Press `enter` at each step to accept the default parameters or enter your own at each step. These parameters and their default values are listed below:
5
+
When you run:
6
6
7
-
- Label: *moonwall_config*
8
-
- Global timeout value: *30000*
9
-
- Environment Name: *default_env*
10
-
- Path for where tests for this environment are kept: *tests/*
11
-
- Network Foundation: *dev*
12
-
- Would you like to generate this config? (no to restart from beginning) (Y/n) *Y*
7
+
`pnpm moonwall init`
13
8
14
-
For more details about configuring your `Moonwall.config` see the [Quick Start Guide](/guide/test/quick-start).
9
+
::: tip
10
+
You can provide the option `--acceptAllDefaults` to YOLO the defaults and save a config file immediately.
11
+
:::
15
12
16
-

13
+
you will be prompted to enter a few key configuration values. Press `Enter` at each prompt to accept the default value or type your own. The prompts include:
14
+
15
+
-**Label:** The name for your config file.
16
+
_Default: `moonwall_config`_
17
+
18
+
-**Global Timeout:** The default timeout for tests (in milliseconds).
19
+
_Default: `30000`_
20
+
21
+
-**Environment Name:** The name of the Moonwall environment you want to create first (you can always make as many new environments as you like).
22
+
_Default: `default_env`_
23
+
24
+
-**Test Directory:** The path where tests for this environment are stored.
25
+
_Default: `tests/default/`_
26
+
27
+
::: info
28
+
By default, the `foundation` is set to `dev` but you can change it to `chopsticks`, `zombie`, or `read_only` as required.
29
+
:::
30
+
31
+
After enter and confirming these values, the following will happen:
32
+
33
+
- Creates the directories `scripts`, `tests`, and `tmp` (if they don’t already exist).
34
+
- Generates a new `moonwall.config.json` file with your specified settings.
35
+
- Writes a sample test file into your test directory to help you get started.
36
+
37
+
## Generated Configuration Example
38
+
39
+
Below is an example of the generated `moonwall.config.json`:
After initialization, a sample test file is created in the specified test directory so you can immediately begin writing tests for your local dev environment.
68
+
69
+
The tests should run successfully with default settings, as it will use a moonbeam docker image to spin up a local dev environment. You can modify this environment to whichever substrate node binary location or docker as you like.
70
+
71
+
::: info
72
+
If a `moonwall.config.json` file already exists, the init command will abort to prevent overwriting your configuration. Remove or rename the existing file if you wish to run the init process again.
73
+
:::
74
+
75
+
For more details about configuration options and further customization, please see the [Quick Start Guide](/guide/test/quick-start).
0 commit comments