Improve CLI and daemon lifecycle usability

This commit is contained in:
Eric Wendland 2026-07-18 15:23:20 +02:00
commit f61cb44dad
14 changed files with 1028 additions and 204 deletions

View file

@ -8,28 +8,25 @@ still named `geth`.
## First 10 Minutes
Build the single binary, initialize an isolated home, start the daemon, and
verify the local control path:
Build the single binary and start a disposable daemon:
```sh
cargo build -p geth
export GETH_HOME="$(mktemp -d)"
printf 'GETH_HOME=%s\n' "$GETH_HOME"
./target/debug/geth init
./target/debug/geth daemon run
./target/debug/geth daemon run --ephemeral
```
Keep the daemon running. In a second shell, reuse the printed `GETH_HOME` value:
Keep the daemon running. In a second shell, reuse the home it printed:
```sh
export GETH_HOME="<same directory>"
./target/debug/geth wait daemon --timeout-ms 30000
./target/debug/geth status --json
./target/debug/geth doctor --json
./target/debug/geth --home <printed-path> wait daemon
./target/debug/geth --home <printed-path> status --json
./target/debug/geth --home <printed-path> doctor --json
```
This creates a local-only identity for evaluation. Before enrolling other
machines, use the owner setup in `geth guide owner-setup`; it records an
Ctrl-C stops the daemon and removes its temporary state. For a persistent
background node, run `geth daemon install`; this initializes local state,
installs a service for the current user, and starts it immediately. Before
enrolling other machines, use `geth guide owner-setup`; it records an
OpenSSH admin public key as the trust anchor and signs the initial keychain
statements without copying the private key into geth state.
@ -43,6 +40,8 @@ Start with these documents when moving beyond the local smoke test:
and signed-operation compatibility rules.
- [`docs/automation-examples.md`](docs/automation-examples.md): shell, Python,
and user-service examples.
- [`docs/user-workflows.md`](docs/user-workflows.md): operator stories from
first run through enrollment, sync, automation, and recovery.
- [`docs/production-readiness-roadmap.md`](docs/production-readiness-roadmap.md):
the pre-deployment gate and its current status.
- [`docs/dogfood-checklist.md`](docs/dogfood-checklist.md): required
@ -57,7 +56,7 @@ It has daemon mode and control mode:
```sh
geth init
geth daemon run
geth daemon service install
geth daemon install
geth status
geth node id
geth resource list
@ -91,14 +90,15 @@ signed records.
The daemon can also install itself as a user service:
```sh
geth daemon service install
geth daemon service status
geth daemon service uninstall
geth daemon install
geth daemon status
geth daemon uninstall
```
The bootstrap service managers are systemd user units on Linux, launchd user
agents on macOS, and per-user scheduled tasks on Windows. These are user-level
services, not system services.
services, not system services. The longer `geth daemon service ...` family is
retained for compatibility and advanced options.
## Transport And SSH
@ -131,14 +131,15 @@ metadata from an authorized peer over Iroh.
The bootstrap implementation provides:
- `geth guide [init|owner-setup|enrollment|keys|overlay|service|completions|smoke-test]` for
- `geth guide [quickstart|init|owner-setup|enrollment|keys|overlay|service|completions|smoke-test]` for
embedded workflow help, including `--admin-key` / `--signing-key` setup
examples
- `geth completions <bash|zsh|fish|powershell|elvish>` for shell completion
scripts generated from the live CLI command tree
- `geth init`
- `geth init --admin-key <public-key> --signing-key <private-key> --node-name <name>`
- `geth daemon run`
- `geth daemon run [--ephemeral]`
- `geth daemon install|start|stop|status|uninstall`
- `geth daemon service install|uninstall|start|stop|status|print`
- `geth status`
- `geth wait daemon|peer|sync --timeout-ms <ms>`
@ -444,25 +445,25 @@ $GETH_HOME/
## Quick Start
In one shell:
For a disposable evaluation, run this in one shell:
```sh
export GETH_HOME="$(mktemp -d)"
cargo run -p geth -- init
cargo run -p geth -- daemon run
cargo run -p geth -- daemon run --ephemeral
```
In another shell:
In another shell, use the home it prints:
```sh
export GETH_HOME="<same dir>"
cargo run -p geth -- status
cargo run -p geth -- node id
cargo run -p geth -- --home <printed-path> status
cargo run -p geth -- --home <printed-path> node id
echo "hello geth" > /tmp/hello-geth.txt
cargo run -p geth -- cas add /tmp/hello-geth.txt
cargo run -p geth -- cas list
cargo run -p geth -- --home <printed-path> cas add /tmp/hello-geth.txt
cargo run -p geth -- --home <printed-path> cas list
```
For normal persistent use, `geth daemon install` initializes and starts a
background user service. Run `geth guide quickstart` to compare startup modes.
## Backup And Restore
`geth backup create --out <dir>` creates an offline directory backup with a