docs: the F7 save gate and the app-owned chain source
All checks were successful
ci / test (pull_request) Successful in 6m49s
ci / sdk (pull_request) Successful in 1m25s

TUI.md: the `last` line's shape when one half of a save is refused, why an
app-owned source saves with an empty `url` while a typed endpoint with no login
is still refused, and the wording the `chain` row carries in a build without
`cuprate-daemon`.

WALLET.md: the same gate from the node's side, and the start contract — a start
that fails part way stops what it spawned and leaves the chain datadir as the
thing a retry reuses.
This commit is contained in:
agent 2026-09-27 23:16:35 -04:00
commit 1e3eceabcb
No known key found for this signature in database
2 changed files with 41 additions and 6 deletions

View file

@ -212,10 +212,23 @@ last save/test answer. The live row is the node's answer, never the draft above
it, and it is re-read by `Ctrl-R`.
`Enter` saves and answers on the status row: `saved · not dialled yet — ctrl-s
starts it, ctrl-t tests the endpoint`, or the node's own refusal in its own
words. The endpoint is validated by `Node::wallet_save_config` — loopback host,
login required — and a rejected form is rejected **before** it is written:
nothing in the sealed record moves and a running wallet is not re-dialled.
starts it, ctrl-t tests the endpoint`, or, when a half is refused, `not saved ·
wallet config: <why> · chain source: <why>` — one line shape either way round,
and the half that did write says so. Both halves are attempted even when one is
refused: a wallet-RPC refusal must not silently drop a chain source the user
just picked. The endpoint's own validator is `Node::wallet_save_config`
(`Wallet::from_config` behind it) — loopback host, login required — and a
rejected form is rejected **before** it is written: nothing in the sealed record
moves and a running wallet is not re-dialled.
The one exception is an **app-owned** chain source (local `monerod`, in-process
Cuprate) with an empty `url`: the child the app spawns generates its own creds
and picks its own port (`creds()` / `pick_port()`,
`Node::start_wallet_child_with` replaces the stored client after the spawn), so
the `url`/`login` rows describe no endpoint the app dials and an empty pair must
not veto the save. A *typed* endpoint with no login is still refused — that is
the externally run RPC path (`ONIONWIRE_WALLET_RPC`), where the refusal is true.
`Ctrl-T` dials the endpoint and answers with the sanitized `PingResult` line
(never the password). `Ctrl-U` clears the focused field, which is how a hidden
login gets replaced.
@ -233,6 +246,13 @@ so in the same frame — `a daemon you do not run sees this wallet's chain
traffic` — because that is the pick that moves chain trust off this box. The
address must parse as `host:port` first.
A build without `cuprate-daemon` says so on the `chain` row, where the choice is
made, rather than offering it and refusing at start: the in-process wording is
followed by `this build has no in-process chain daemon — rebuild with --features
cuprate-daemon` (`crate::cuprate::NO_FEATURE_MSG`, clamped to the frame width).
The pick is still offered — builds with the feature exist, and a stored
in-process source must still be readable.
Esc is the single exit and wipes the login buffer (`Zeroizing<String>`).
## Wallets & settings (`F9` / `/settings`)

View file

@ -98,7 +98,7 @@ the screen that picks the chain source:
| `Ctrl-X` | Stop it (idempotent). |
| `Ctrl-R` | Re-read the live node line (`off` / `connecting` / `syncing` / `ready` / `exited`). |
| `Enter` | Save the endpoint and chain source without dialling or starting anything. |
| `chain` row + `space` | Receive-only / local `monerod` / remote daemon / in-process Cuprate. |
| `chain` row + `space` | Receive-only / local `monerod` / remote daemon / in-process Cuprate. In a build without `cuprate-daemon` the row carries the `rebuild with --features cuprate-daemon` wording; the pick is still offered. |
| `network` row + `space` | In-process network: mainnet (unvalidated) or testnet. |
State shown: `off` / `connecting` / `syncing` / `ready` / `exited`, plus a
@ -113,7 +113,22 @@ Once a probe has read the daemon, the line can include `sync <height>/<target>`
`get_info`, or the local daemon's `get_info` when wallet RPC does not answer).
`sync 0/0` or no segment means **unknown**, not caught up.
`start` is idempotent: a live child is reported, not respawned.
`start` is idempotent: a live child is reported, not respawned. A start that
fails part way is **all or nothing**: whatever that call spawned — the in-process
daemon, a `monerod`, the SOCKS child, the wallet RPC — is stopped before the
error is handed back (`WalletChild::start_with_creds`), because the caller
receives the error rather than the client, so a daemon left running would have no
owner and no handle, and would hold `18081` against the next start. The same
contract is asserted one level up
(`node::tests::a_missing_binary_fails_the_start_and_leaves_no_child`), and what a
retry reuses is the chain **datadir** on disk, never a process that outlived its
owner.
A save on an app-owned source needs no `url`/`login`: the child the app spawns
generates its own RPC creds and picks its own port, and
`Node::start_wallet_child_with` replaces the stored client after the spawn. A
typed endpoint with no login is still refused (`Wallet::from_config`), and the
screen reports both halves of a save on one line. See `docs/TUI.md`.
## Chain source