feat(wallet): mainnet pruned and full on-device chain modes
All checks were successful
ci / test (pull_request) Successful in 5m45s
ci / sdk (pull_request) Successful in 1m34s
ci / fuzz (pull_request) Successful in 4m51s
android-ci / android (pull_request) Successful in 13m2s

Cuprate in-process and TUI keys 1/2/3 pick mainnet pruned, mainnet
full, or experimental testnet. Datadirs are split so a prune store
cannot mix with a full one. Android storage floors scale with the
choice. Cuprate remains pre-production; mainnet is unvalidated.
This commit is contained in:
agent 2026-09-19 12:54:35 -04:00
commit 5080652e3b
No known key found for this signature in database
11 changed files with 397 additions and 77 deletions

View file

@ -29,7 +29,7 @@ use crate::ratelimit::TokenBucket;
use crate::sanitize;
use crate::session::{self, Keys};
use crate::store::{Friend, FriendProfile, Message, Payment, PaymentWrite, Store};
use crate::wallet::{self, Readiness, Wallet, WalletConfig, WalletStatus};
use crate::wallet::{self, ChainNetwork, ChainSource, Readiness, Wallet, WalletConfig, WalletStatus};
use crate::wallet_child::{ChildConfig, WalletChild, WalletChildState, WalletChildStatus};
pub struct RotateResult {
@ -567,6 +567,10 @@ impl Node {
// ----- the app-owned wallet child (`src/wallet_child.rs`) ----------------
pub fn home(&self) -> &Path {
&self.home
}
/// The child settings this node would spawn with: the stored record, or the
/// defaults (receive-only, binaries by name) when nothing was ever set.
pub fn wallet_child_config(&self) -> ChildConfig {
@ -593,6 +597,30 @@ impl Node {
Ok(())
}
/// Store an in-process Cuprate source. Datadirs are split so a pruned
/// mainnet store cannot mix with a full one (Cuprate cannot un-prune).
pub fn set_in_process_cuprate(
&self,
network: ChainNetwork,
prune: bool,
) -> Result<(), String> {
let mut cfg = self.wallet_child_config();
if cfg.wallet_rpc_bin.as_os_str().is_empty() {
cfg.wallet_rpc_bin = PathBuf::from("monero-wallet-rpc");
}
let name = match (network, prune) {
(ChainNetwork::Mainnet, true) => "mainnet-pruned",
(ChainNetwork::Mainnet, false) => "mainnet-full",
(ChainNetwork::Testnet, _) => "testnet",
};
cfg.source = ChainSource::InProcessCuprate {
datadir: self.home.join("chain").join(name),
network,
prune: matches!(network, ChainNetwork::Mainnet) && prune,
};
self.set_wallet_child_config(&cfg)
}
/// Start the app-owned wallet child and point this node's wallet at it.
///
/// Idempotent: a live wallet child is reported, not respawned. Spawning is