feat(wallet): mainnet pruned and full on-device chain modes
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:
parent
0acf89a0b4
commit
5080652e3b
11 changed files with 397 additions and 77 deletions
|
|
@ -724,6 +724,8 @@ class WireViewModel(app: Application) : AndroidViewModel(app) {
|
|||
// an onion daemon outright while no `arti` is bundled.
|
||||
artiBin = expectedArtiPath(),
|
||||
walletFilename = WalletChildBinaries.WALLET_FILENAME,
|
||||
mainnet = false,
|
||||
prune = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
@ -752,6 +754,8 @@ class WireViewModel(app: Application) : AndroidViewModel(app) {
|
|||
walletRpcBin = bins.walletRpc.orEmpty(),
|
||||
artiBin = expectedArtiPath(),
|
||||
walletFilename = WalletChildBinaries.WALLET_FILENAME,
|
||||
mainnet = false,
|
||||
prune = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
@ -767,12 +771,14 @@ class WireViewModel(app: Application) : AndroidViewModel(app) {
|
|||
* is what launches the node *and* the wallet child (one call in the core).
|
||||
*
|
||||
* `monerodDatadir` is left empty on purpose: the SDK resolves that to
|
||||
* `$ONIONWIRE_HOME/chain`, the same per-identity directory a spawned `monerod`
|
||||
* would use, so Kotlin never invents an absolute path. `monero-wallet-rpc` is
|
||||
* still required — Cuprate has no wallet layer, so the subprocess stays, and the
|
||||
* core rejects a config without it.
|
||||
* `$ONIONWIRE_HOME/chain/{testnet,mainnet-pruned,mainnet-full}` from
|
||||
* [mainnet] and [prune], so Kotlin never invents an absolute path.
|
||||
*/
|
||||
suspend fun setInProcessCuprate(bins: WalletChildBinaryPaths): Result<Unit> =
|
||||
suspend fun setInProcessCuprate(
|
||||
bins: WalletChildBinaryPaths,
|
||||
mainnet: Boolean,
|
||||
prune: Boolean,
|
||||
): Result<Unit> =
|
||||
withContext(Dispatchers.IO) {
|
||||
runCatching {
|
||||
requireWire().setChainSource(
|
||||
|
|
@ -787,6 +793,8 @@ class WireViewModel(app: Application) : AndroidViewModel(app) {
|
|||
// clearnet, so the core never spawns the SOCKS child.
|
||||
artiBin = expectedArtiPath(),
|
||||
walletFilename = WalletChildBinaries.WALLET_FILENAME,
|
||||
mainnet = mainnet,
|
||||
prune = prune,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue