sdk: land the on-device Cuprate chain source on main (replay of #111's SDK commit) #112

Merged
sirius merged 1 commit from onionwire/t_52f8de0f-cuprate-land-the-sdk-surface-on-main-pr into main 2026-09-18 19:44:46 +00:00
Owner

What this is

The SDK half of the in-process Cuprate chain source, replayed onto main.

PR #111 was merged with base = onionwire/t_04975420-cuprate-land-the-in-process-chain-source (the core card's branch), so main only ever got the core half via PR #110. This PR carries the SDK commit (64a1f29) on top of main (25e029e) with no core commits replayed — the tree change is byte-identical to that commit's own diff:

$ diff <(git diff 64a1f29^ 64a1f29) <(git diff origin/main e89dd9e)
IDENTICAL_TREE_CHANGE

Files (scope-confined: no src/**, no root manifest, no android/**, no workflows):

 crates/onionwire-sdk/Cargo.lock | 1480 ++++++++++++++++++++++++++++-
 crates/onionwire-sdk/Cargo.toml |   10 +
 crates/onionwire-sdk/src/lib.rs |  280 ++++-
 docs/WALLET.md                  |   20 +-
 4 files changed, 1758 insertions(+), 32 deletions(-)

What lands for Kotlin: ChainChoice.InProcessCuprate, the SDK's own cuprate-daemon feature (pass-through to the core's), an empty monerod_datadir resolved to $ONIONWIRE_HOME/chain, and wallet_status gaining chain_in_process / node_available / node_state beside the core's five state words. start_wallet_child() is the whole lifecycle for the in-process source (the core starts the node and the wallet child in that one call). No second state machine, no timer, no env var.

Why it blocks the release

Enabling cuprated from the Android Gradle build is cargo ... --features cuprate-daemon in the SDK crate. A feature key that does not exist in the SDK manifest cannot be enabled, so main today ships an APK with no cuprate in it.

Evidence (all commands run in a worktree at this commit)

  1. cargo test --locked -> exit 0, 33 + 1 + 1 tests passed (feature off).

  2. cargo clippy --locked --all-targets -- -D warnings -> Finished dev profile, exit 0.

  3. cargo test --locked --features cuprate-daemon -> exit 0, same test set green with the daemon compiled in.

    cargo tree --locked --features cuprate-daemon -e normal -i cuprated resolves cuprated v0.1.0-preview (rev 4f8fcd1bf468f566fcd89c460d50de4adb6825bf) under onionwire-sdk.

  4. cargo clippy --locked --features cuprate-daemon --all-targets -- -D warnings -> exit 0.

  5. The load-bearing one, with the NDK 28.2.13676358 env and -P 26:

    cargo check --release --target aarch64-linux-android --features cuprate-daemon -> Finished release profile, exit 0. Fresh artifacts in a new target dir: 631 metadata files, libcuprated-*.rmeta for aarch64-linux-android, and RandomX cross-built (.../build/randomx-rs-*/out/lib/librandomx.a).

  6. grep -c 'name = "cuprated"' crates/onionwire-sdk/Cargo.lock -> 1 (was 0 on main).

  7. grep -n 'cuprate-daemon' crates/onionwire-sdk/Cargo.toml -> line 28, cuprate-daemon = ["onionwire/cuprate-daemon"] under [features].

  8. Root crate unaffected: cargo test --locked --target x86_64-unknown-linux-gnu -> exit 0.

Notes

  • crates/onionwire-sdk/src/lib.rs is 2 rustfmt hunks off, and main's version of the same file is the same 2 hunks off — inherited churn, not introduced here, and deliberately not reformatted (repo-wide rustfmt churn is out of scope).
  • docs/WALLET.md changes are the SDK-facing paragraph plus the chain-source label list; no other doc touched.
## What this is The SDK half of the in-process Cuprate chain source, replayed onto `main`. PR #111 was merged with `base` = `onionwire/t_04975420-cuprate-land-the-in-process-chain-source` (the core card's branch), so `main` only ever got the core half via PR #110. This PR carries the SDK commit (`64a1f29`) on top of `main` (`25e029e`) with **no core commits replayed** — the tree change is byte-identical to that commit's own diff: ``` $ diff <(git diff 64a1f29^ 64a1f29) <(git diff origin/main e89dd9e) IDENTICAL_TREE_CHANGE ``` Files (scope-confined: no `src/**`, no root manifest, no `android/**`, no workflows): ``` crates/onionwire-sdk/Cargo.lock | 1480 ++++++++++++++++++++++++++++- crates/onionwire-sdk/Cargo.toml | 10 + crates/onionwire-sdk/src/lib.rs | 280 ++++- docs/WALLET.md | 20 +- 4 files changed, 1758 insertions(+), 32 deletions(-) ``` What lands for Kotlin: `ChainChoice.InProcessCuprate`, the SDK's own `cuprate-daemon` feature (pass-through to the core's), an empty `monerod_datadir` resolved to `$ONIONWIRE_HOME/chain`, and `wallet_status` gaining `chain_in_process` / `node_available` / `node_state` beside the core's five state words. `start_wallet_child()` is the whole lifecycle for the in-process source (the core starts the node and the wallet child in that one call). No second state machine, no timer, no env var. ## Why it blocks the release Enabling cuprated from the Android Gradle build is `cargo ... --features cuprate-daemon` **in the SDK crate**. A feature key that does not exist in the SDK manifest cannot be enabled, so `main` today ships an APK with no cuprate in it. ## Evidence (all commands run in a worktree at this commit) 1. `cargo test --locked` -> exit 0, 33 + 1 + 1 tests passed (feature off). 2. `cargo clippy --locked --all-targets -- -D warnings` -> `Finished dev profile`, exit 0. 3. `cargo test --locked --features cuprate-daemon` -> exit 0, same test set green with the daemon compiled in. `cargo tree --locked --features cuprate-daemon -e normal -i cuprated` resolves `cuprated v0.1.0-preview (rev 4f8fcd1bf468f566fcd89c460d50de4adb6825bf)` under `onionwire-sdk`. 4. `cargo clippy --locked --features cuprate-daemon --all-targets -- -D warnings` -> exit 0. 5. The load-bearing one, with the NDK 28.2.13676358 env and `-P 26`: `cargo check --release --target aarch64-linux-android --features cuprate-daemon` -> `Finished release profile`, exit 0. Fresh artifacts in a new target dir: 631 metadata files, `libcuprated-*.rmeta` for `aarch64-linux-android`, and RandomX cross-built (`.../build/randomx-rs-*/out/lib/librandomx.a`). 6. `grep -c 'name = "cuprated"' crates/onionwire-sdk/Cargo.lock` -> 1 (was 0 on `main`). 7. `grep -n 'cuprate-daemon' crates/onionwire-sdk/Cargo.toml` -> line 28, `cuprate-daemon = ["onionwire/cuprate-daemon"]` under `[features]`. 8. Root crate unaffected: `cargo test --locked --target x86_64-unknown-linux-gnu` -> exit 0. ## Notes - `crates/onionwire-sdk/src/lib.rs` is 2 rustfmt hunks off, and `main`'s version of the same file is the same 2 hunks off — inherited churn, not introduced here, and deliberately not reformatted (repo-wide rustfmt churn is out of scope). - `docs/WALLET.md` changes are the SDK-facing paragraph plus the chain-source label list; no other doc touched.
sdk: expose the on-device Cuprate chain source (choice, lifecycle, node status)
All checks were successful
ci / test (pull_request) Successful in 5m5s
ci / sdk (pull_request) Successful in 1m4s
android-ci / android (pull_request) Successful in 8m31s
ci / fuzz (pull_request) Successful in 4m47s
e89dd9eaee
ChainChoice gains InProcessCuprate, the SDK passes the core's cuprate-daemon
feature through as its own, and an empty monerod_datadir for that kind resolves
to $ONIONWIRE_HOME/chain so Kotlin never invents a path. wallet_status now
carries chain_in_process / node_available / node_state beside the core's five
state words; no second state machine, no timer, no env var.

start/stop stay the core's pass-through: one call launches the node and the
wallet child, one stops both, both idempotent.

Replayed onto main (25e029e): PR #111 was merged into the core branch
onionwire/t_04975420-cuprate-land-the-in-process-chain-source, not main, so
main had only the core half (from PR #110). This is the same tree change with
no core commits replayed.
sirius merged commit 773dacb062 into main 2026-09-18 19:44:46 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!112
No description provided.