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
feat: add clean command, make init non-destructive
init no longer deletes existing state. It refuses if the home directory
has contents and directs the user to run `clean` first. config.toml is
preserved across clean by default (--all to remove it). Removes --force
flag from init.
foc-devnet clean --all # Remove everything including config
24
+
foc-devnet clean --images # Remove state + Docker images
25
+
foc-devnet clean --all --images # Full reset
26
+
```
27
+
9
28
### `init`
10
29
Initializes foc-devnet by downloading repositories, building Docker images, and preparing the environment.
11
30
31
+
Requires a clean home directory. If existing state is present, `init` will refuse and ask you to run `clean` first. If a `config.toml` was preserved across `clean`, it is reused (with any CLI overrides applied on top).
32
+
12
33
```bash
13
34
foc-devnet init [OPTIONS]
14
35
```
@@ -21,7 +42,6 @@ foc-devnet init [OPTIONS]
21
42
-`--yugabyte-url <URL>` - Yugabyte download URL
22
43
-`--yugabyte-archive <PATH>` - Local Yugabyte archive file
23
44
-`--proof-params-dir <PATH>` - Local proof params directory
24
-
-`--force` - Force regeneration of config file. Useful when switching between configurations.
25
45
-`--rand` - Use random mnemonic instead of deterministic one. Use this for unique test scenarios.
26
46
27
47
**Source Format:**
@@ -35,8 +55,7 @@ foc-devnet init [OPTIONS]
35
55
```bash
36
56
foc-devnet init \
37
57
--lotus local:/home/user/lotus \
38
-
--curio gitbranch:pdpv0 \
39
-
--force
58
+
--curio gitbranch:pdpv0
40
59
```
41
60
42
61
### `build`
@@ -273,8 +292,8 @@ tag = "synapse-sdk-v0.36.1"
273
292
Defaults are defined in code (see [`src/config.rs`](src/config.rs)`Config::default()`) and written to `config.toml` during `init`. This means:
274
293
275
294
-**First-time setup:** Running `foc-devnet init` creates `config.toml` with current defaults from code
276
-
-**Updating defaults:** When a new version of `foc-devnet` includes updated defaults (e.g., newer Lotus version), run `foc-devnet init --force` to regenerate `config.toml` with the new defaults
277
-
-**Preserving customizations:**After regenerating, you'll need to reapply any custom settings you had modified
295
+
-**Updating defaults:** When a new version of `foc-devnet` includes updated defaults (e.g., newer Lotus version), run `foc-devnet clean --all` then `foc-devnet init` to regenerate `config.toml` with the new defaults
296
+
-**Preserving config across re-init:**Running `foc-devnet clean` (without `--all`) preserves your `config.toml`, so a subsequent `init` reuses your existing settings
278
297
-**Source of truth:** The code defines what defaults are available; `config.toml` stores your specific configuration
279
298
280
299
### Editing Config
@@ -283,8 +302,9 @@ Defaults are defined in code (see [`src/config.rs`](src/config.rs) `Config::defa
283
302
# Edit manually
284
303
vim ~/.foc-devnet/config.toml
285
304
286
-
# Or use init --force to regenerate
287
-
foc-devnet init --force
305
+
# Or regenerate from defaults
306
+
foc-devnet clean --all
307
+
foc-devnet init
288
308
```
289
309
290
310
---
@@ -475,10 +495,9 @@ cd ~/.foc-devnet/docker/volumes/run-specific
475
495
ls | grep --invert-match "$CURRENT_RUN"| xargs rm -rf
476
496
```
477
497
478
-
**Complete nuclear reset (delete EVERYTHING including config):**
498
+
**Complete reset (delete EVERYTHING including config):**
479
499
```bash
480
-
# This deletes all runs, config, repos, binaries, keys - use with caution!
0 commit comments