tui: the wallet-rpc binary is a path the app resolves, not a bare name #171
Loading…
Reference in a new issue
No description provided.
Delete branch "onionwire/t_35a220dd-onionwire-tui-monero-wallet-rpc-is-a-pat"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follows #170. Base is that branch, not
main: these four commits sit strictly on top of the F7 save/start work, so the diff here is only this card's. Retarget tomainonce #170 lands. Taskt_35a220dd.What was wrong
The F7 screen could save a wallet-RPC endpoint and a chain source, but nothing decided which
monero-wallet-rpcthe child would spawn: the stored value was the bare namemonero-wallet-rpc, so a host with no such file onPATHhad no way to start a wallet at all, and the release tarball did not carry the binary either.The resolver
wallet_child::resolve_wallet_rpc_bin(src/wallet_child.rs), in order:<directory of the running executable>/monero-wallet-rpc— where the release tarball puts it, so an unpacked release needs nothing configured;<exe dir>/share/onionwire/monero-wallet-rpc— a packaged install;monero-wallet-rpconPATH.DEFAULT_WALLET_RPC_BIN("monero-wallet-rpc") is deliberately the last step, never the assumed default: a bare name that is not onPATHis exactly the failure this card is about.default_wallet_rpc_bin()is that resolution with no explicit path, and it is now whatChildConfig::default,ChildConfig::from_node, and the node's three chain-source setters (set_in_process_chain,set_remote_daemon,set_local_chain) use, so there is one entry point. The splitresolve_wallet_rpc_bin_in(explicit, exe_dir, path_var)is the same function with both ambient inputs spelled out, which is what makes the search order testable without mutating the process environment.F7 grows a
binaryrow that prints the resolved answer (orNO_WALLET_RPC_MESSAGE), typed into the wallet-RPC half of the same read-modify-write as the endpoint, withCtrl-Uclearing back to auto. The row sits directly above the chain picker.Release: the binary ships beside the app
Both release build jobs (aarch64, x86_64) now fetch the official Monero release tarball inside the build container and check it three ways before anything can be published:
hashes.txtfrom getmonero.org must list the pinned tarball, the tarball must match its pinned sha256, and the extractedmonero-wallet-rpcmust match its own pinned sha256. The binary is copied out of the container and published asmonero-wallet-rpc-<target>plus a.sha256, and the publish job's allow-list names all eight assets so a missing one fails the release instead of silently shipping without it.scripts/build-release-local.shdoes the same for the x86_64 host fallback. Monero's C++ tree is never built here.Pins: Monero
v0.18.5.1(Monero 'Fluorine Fermi' (v0.18.5.1-release)).22a7dda7...cc9958c0caf042...7b9398dbcc1e3aff7...ce2019a65675e254b8...e8aca0ba7a48dbfThe aarch64 target uses Monero's
armv8tarball name; nomonero-linux-arm64-*asset exists. That naming difference is written down indocs/WALLET.mdso the next version bump does not go hunting for it. The extracted binaries are neither stripped nor rewritten: their sha256 is the record of the bytes that ship.Evidence
New tests: 3 in
wallet_child(explicit wins over everything; the bundled copy beside the exe beats aPATHname; a non-executable or missing candidate is not an answer), 4 intui(the row exists, prints the resolved path or the not-found wording, is in theTaborder, and its value reaches the store), 1 adjusted innode(the old assertion pinned the bare name; it now pins the resolver's answer, so the test no longer depends on this host'sPATH).Real end-to-end, no test harness: a probe crate against the crate's public API (
resolve_wallet_rpc_bin,ChildConfig::build,WalletChild::start), run from two directories withPATHstripped ofmonero-wallet-rpc— the host happens to have one in~/.local/bin, so the strippedPATHis what makes the probe honest:That is
current_exe→ resolver → spawn → readiness gate, on the real binary, in a real process.The workflow was checked without CI: the YAML parses (all four jobs, both new env blocks), every
runbody passesbash -n, and the fetch/verify/extract chain was executed verbatim on this host for both targets — each matched getmonero'shashes.txt, its tarball sha256 and its extracted sha256, and the x86_64 binary runs (--versionreportsv0.18.5.1-release,lddlists only libm/libpthread/libc). The x86_64 pinned hash was independently reproduced by a second download of the same release.Not verified
file(1)only; an x86_64 host cannot execute it.docs/WALLET.mdsays this plainly.Ctrl-Sin a terminal here. #170 carries the live F7 run.wallet_child::tests::in_process_source_launches_a_daemon_and_stop_shuts_it_downflakes under--test-threads=8withcuprate-daemon(in-process daemon: launch: Address already in use (os error 98)on 18081, racingnode::tests' own 18081 holders). It is pre-existing and unrelated: that test overrides the binary withwith_wallet_rpc_binand this diff binds nothing. It passes 151/0 serially and 3/3 in isolation, and no CI job runs that feature-gated suite. Left alone rather than fixed inside this card.F7 row position in the
TaborderRow 3 of 10, between the view-only toggle and the chain picker:
url(0),login(1),view-only(2),binary(3),chain(4),daemon(5),monerod(6),datadir(7),prune(8),network(9) —SETUP_ROWSis 10, andTab/BackTabcycle the whole list and wrap. Adding the row shiftedSETUP_ROW_CHAINand everything after it by one, which the F7 tests pin (the_wallet_rpc_row_is_reachable_and_drawnwalks the order and asserts the row above the chain picker is this one;the_in_process_network_is_still_selectablestill reaches the network picker and picks a network).The in-process Cuprate network
Unchanged by this card, and still mainnet remains unvalidated — testnet only. Nothing here touches
src/cuprate.rs, the chain source, or the F7 network picker; thebinaryrow only decides whichmonero-wallet-rpca start will spawn.Notes for the reviewer
docs/WALLET.mdcarries the provenance record (source URL, version, both hashes per target, and the three checks).docs/TUI.md's F7 row table and its two-half save wording are now one row and one half stale, but that file is outside this card's scope, so it was left untouched on purpose.src/store.rs, no schema, no SDK and no Android change:crates/onionwire-sdkdoes not touch the wallet child, and the Android build already ships its ownmonero-wallet-rpcper ABI (android/MONERO_BINARIES.md).wallet: the app resolves monero-wallet-rpc beside itself, and the release ships itto tui: the wallet-rpc binary is a path the app resolves, not a bare name