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
Copy file name to clipboardExpand all lines: scripts/backup-helper/README.md
+59-53Lines changed: 59 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,67 +8,73 @@ This tool turns the inventory into:
8
8
9
9
The input DB is treated as strictly read-only, and all derived state lives in `tracking.db` under the output directory, so `rm -rf <dir>` is always a safe reset.
***`create`** — Reads the input DB, deduplicates shards by `shard_cid` across all spaces, and generates:
14
+
15
+
*`<dir>/tracking.db`
16
+
*`<dir>/manifest.aria2`
17
+
18
+
Safe to re-run. Produces identical output for unchanged input and never overwrites an existing `piece_cid`.
19
+
20
+
***`download`** — Starts a local aria2 RPC worker and downloads shards from `tracking.db` into:
21
+
22
+
```
23
+
<dir>/shards/<shardCID>.car
24
+
```
25
+
26
+
Resumable via `tracking.db`, `aria2.session`, and `.aria2` control files. If `--port` is not provided, a free localhost port is selected automatically.
19
27
20
-
-`create` — read the input DB, deduplicate by `shard_cid` across every space,
21
-
populate `<dir>/tracking.db`, and stream `<dir>/manifest.aria2`. Idempotent
22
-
on re-run: produces byte-identical output for unchanged input and never
23
-
clobbers a previously-computed `piece_cid` in tracking.db.
24
-
-`download` — starts a local aria2 RPC worker directly from the command,
25
-
then schedules shards from `tracking.db`.
26
-
Writes each CAR to `<dir>/shards/<shardCID>.car`. Resumable via shard status
27
-
in `tracking.db`, plus aria2's session and per-file `.aria2` control files.
28
-
`--port N` is optional; if omitted, `download` picks a free localhost port
29
-
for that run automatically. The `manifest.aria2` and `aria2.session` files are
30
-
just generated artifacts that can be useful for debugging if needed.
31
-
-`prepare` — process completed local shard CARs from `tracking.db`, compute
32
-
pieceCID v2 when `piece_cid IS NULL`, and rename each prepared CAR from
33
-
`<shardCID>.car` to `<pieceCID>.car`. Failures land in `tracking.db`'s
34
-
`failures` table under `stage='prepare'`; rows are deleted on a later
35
-
successful attempt.
36
-
-`commit` — uses `tracking.db` plus Synapse to park prepared pieces and commit
Failures are recorded in `tracking.db` (`stage='prepare'`) and cleared automatically after a successful retry.
35
+
36
+
***`commit`** — Parks prepared pieces in Curio and performs on-chain commits concurrently using synapse-core. Piece parking is done through:
37
+
38
+
```bash
39
+
curio toolbox import-pieces \
40
+
--source <dir> \
41
+
--target <target> \
42
+
--batch-size N
43
+
```
44
+
45
+
The command continuously imports pieces into Curio while concurrently submitting eligible commits on-chain. Progress is persisted in `tracking.db` (`root_shards` and `migration_metadata`), allowing the operation to be safely resumed after interruptions.
0 commit comments