| … | … | @@ -0,0 +1,62 @@ |
| 1 | # hyper-inspector |
| 2 | |
| 3 | Inspect, audit and manage Hypercore / Hyperdrive corestores. |
| 4 | |
| 5 | Answers the questions you get stuck on when a store misbehaves: what cores are in here, which |
| 6 | of them is eating the disk, what files does this drive hold, and can I get them back out. |
| 7 | |
| 8 | **Reads never mutate.** `extract` copies files out; nothing writes into a store. |
| 9 | |
| 10 | ## Install |
| 11 | |
| 12 | ```sh |
| 13 | npm install -g hyper-inspector |
| 14 | ``` |
| 15 | |
| 16 | ## Usage |
| 17 | |
| 18 | ```sh |
| 19 | hyper-inspector scan # find every corestore under ~/ |
| 20 | hyper-inspector audit # sizes, lock status, staleness |
| 21 | hyper-inspector usage ~/.config/app/server-data/db # which cores consume what |
| 22 | hyper-inspector drive ~/.config/app/server-data # traverse a Hyperdrive |
| 23 | ``` |
| 24 | |
| 25 | ⚠ **A running daemon holds a RocksDB lock.** Pass `--readonly` to inspect a live store instead |
| 26 | of stopping it. |
| 27 | |
| 28 | ## Commands |
| 29 | |
| 30 | | | | |
| 31 | |---|---| |
| 32 | | `scan [dir]` | find all corestores (default `~/`) | |
| 33 | | `audit [dir]` | sizes, lock status, staleness | |
| 34 | | `du [dir]` | Hyperdrive disk usage across all corestores | |
| 35 | | `inspect <db-path>` | inspect a corestore's RocksDB (the `db/` dir) | |
| 36 | | `apps <db-path>` | list `pear://` apps in a platform corestore | |
| 37 | | `cores <storage-path>` | enumerate cores (path containing the `CORESTORE` file) | |
| 38 | | `drives <storage-path>` | discover Hyperdrives | |
| 39 | | `drive <storage-path> [--key <hex>]` | open a drive and list its files | |
| 40 | | `ls <db-path> <dataPtr>` | list a drive's files by RocksDB dataPointer | |
| 41 | | `usage <db-path>` | deep analysis — bytes on disk per core | |
| 42 | | `blocks <storage-path> --key <hex>` | read raw Hyperbee blocks, decode entries | |
| 43 | | `extract <storage-path> --data-ptr <n> --out <dir>` | copy files **out** of a drive | |
| 44 | |
| 45 | **Options:** `--readonly`, `--limit <n>` (default 100000), `--key <hex>`, `--data-ptr <n>`, |
| 46 | `--out <dir>`, `--filter <substr>`, `--max-bytes <n>`, `--dry-run` |
| 47 | |
| 48 | Note the two path shapes: `<db-path>` ends at the `db/` directory, `<storage-path>` is the |
| 49 | directory containing the `CORESTORE` file. Passing one where the other is expected is the usual |
| 50 | first error. |
| 51 | |
| 52 | ## Recovering files from a drive |
| 53 | |
| 54 | ```sh |
| 55 | hyper-inspector cores ~/.config/app/server-data --readonly # find the dataPointer |
| 56 | hyper-inspector extract ~/.config/app/server-data \ |
| 57 | --data-ptr 3 --out /tmp/dump --readonly --dry-run # check first |
| 58 | ``` |
| 59 | |
| 60 | ## License |
| 61 | |
| 62 | Not yet declared. |