wallet: app-owned child lifecycle + user-chosen ChainSource #73
Loading…
Reference in a new issue
No description provided.
Delete branch "wt/t_69ce8e46"
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?
This card builds on PR #66 (feat/wallet-create-import, open, not yet merged). The app now owns monero-wallet-rpc -- and monerod when the chain source is local -- instead of requiring the user to start them and export ONIONWIRE_WALLET_RPC.
What changed
Verification
Scope (per card): allowed src/wallet.rs, src/wallet_child.rs (new), src/node.rs, src/lib.rs, tests/wallet.rs, tests/node*.rs, docs/WALLET.md. Did not touch src/pay.rs, src/tui.rs, src/store.rs schema beyond the wallet_child table + sealed load/save, android/, crates/onionwire-sdk/, .forgejo/, scripts/, docs/PROTOCOL.md.
Base: feat/wallet-create-import (PR #66). Do not rebase onto main.
The app now owns monero-wallet-rpc (and monerod when the chain source is local) instead of requiring the user to start them and export ONIONWIRE_WALLET_RPC. - ChainSource enum: None / Local { monerod_bin, datadir } / Remote { host, port }. No default remote node; Remote is only constructed from explicit user input. A .onion Remote is refused without a SOCKS proxy (separate card). - WalletChild in src/wallet_child.rs spawns monero-wallet-rpc with --rpc-bind-ip 127.0.0.1, a random free loopback port, generated --rpc-login, and --wallet-dir /wallet; monerod too for a local source. --trusted-daemon is never passed. - Generated RPC creds are sealed in the encrypted SQLCipher store (wallet_child table, AEAD on top of whole-db encryption), never a plaintext file. The Wallet client is built from the generated loopback URL, not from_env. - Readiness predicate: chain_ready() requires synchronized==true, height>0, height>=target_height; can_spend() and can_verify_receipts() gate on it. Unsynced -> receipts stay verified=0, spend refused with a clear message. - Backend-aware timeouts: local management calls keep 5s; chain-dependent calls (get_info, get_transfers, transfer) get 60s (CHAIN_RPC_TIMEOUT), because a first sync or a remote daemon outlasts 5s and a 5s cap there is what left receipts permanently unverified. - node.rs ingest_receipt gates on can_verify_receipts() instead of configured() alone. - docs/WALLET.md rewritten for the child lifecycle + chain source. Base: feat/wallet-create-import (PR #66). Do not rebase onto main. Co-Authored-By: Hermes Agent <agent@local>b45dbf95be8331a2dde6