From cff2017b3d97ae077d1d5f4e4303ec4a77156c6e Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 09:36:01 -0300 Subject: [PATCH 01/12] docs: add spark-regtest skill Co-Authored-By: Claude Opus 5.5 --- .../plugins/.claude-plugin/marketplace.json | 5 ++ .../spark-regtest/.claude-plugin/plugin.json | 4 ++ .claude/plugins/spark-regtest/README.md | 18 +++++ .../skills/spark-regtest/SKILL.md | 67 +++++++++++++++++++ README.md | 2 + 5 files changed, 96 insertions(+) create mode 100644 .claude/plugins/spark-regtest/.claude-plugin/plugin.json create mode 100644 .claude/plugins/spark-regtest/README.md create mode 100644 .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md diff --git a/.claude/plugins/.claude-plugin/marketplace.json b/.claude/plugins/.claude-plugin/marketplace.json index 4854c52463..76d8ec79ee 100644 --- a/.claude/plugins/.claude-plugin/marketplace.json +++ b/.claude/plugins/.claude-plugin/marketplace.json @@ -9,6 +9,11 @@ "name": "blocktank-api", "source": "./blocktank-api", "description": "Blocktank staging API: regtest mining, deposits, invoice payments and lookups of existing orders." + }, + { + "name": "spark-regtest", + "source": "./spark-regtest", + "description": "Run a Bitkit dev build on Spark's regtest: Lightspark's hosted network or bitkit-docker's local ./spark stack." } ] } diff --git a/.claude/plugins/spark-regtest/.claude-plugin/plugin.json b/.claude/plugins/spark-regtest/.claude-plugin/plugin.json new file mode 100644 index 0000000000..cc467de929 --- /dev/null +++ b/.claude/plugins/spark-regtest/.claude-plugin/plugin.json @@ -0,0 +1,4 @@ +{ + "name": "spark-regtest", + "description": "Run a Bitkit dev build on Spark's regtest: Lightspark's hosted network or bitkit-docker's local ./spark stack." +} diff --git a/.claude/plugins/spark-regtest/README.md b/.claude/plugins/spark-regtest/README.md new file mode 100644 index 0000000000..b501884994 --- /dev/null +++ b/.claude/plugins/spark-regtest/README.md @@ -0,0 +1,18 @@ +# Spark Regtest Plugin + +A Claude Code plugin with the `spark-regtest` skill: build a Bitkit dev build for Spark's regtest, fund it and pick +between Lightspark's hosted regtest and bitkit-docker's local `./spark` stack. + +## Setup + +Run once from the repo root (re-run anytime to update): + +```sh +./.claude/install-plugins.sh +``` + +Restart Claude Code once. The `spark-regtest:spark-regtest` skill is then available. + +## Usage + +The skill triggers on things like "spark regtest", "fund spark", "spark faucet", "ESPLORA_URL" or "./spark". diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md new file mode 100644 index 0000000000..67f7807610 --- /dev/null +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -0,0 +1,67 @@ +--- +name: spark-regtest +description: > + This skill should be used when running a Bitkit dev build on Spark's regtest: building it for + Spark, funding Savings or the Spark (Spending) balance, paying between dev builds, Move to Spark, + or Spark emergency exit tests. Triggers: "spark regtest", "fund spark", "spark faucet", + "ESPLORA_URL", "SPARK_LOCAL_CONFIG_B64", "./spark", "Lightspark regtest", "BREEZ_API_KEY". +version: 0.1.0 +--- + +# Spark regtest + +Dev builds run Spark through the Breez SDK. Two Spark regtest networks exist, and neither shares a chain with Blocktank's +staging regtest (`stag0.blocktank.to`). Coins and Lightning payments never cross between them. + +| | Lightspark hosted (default) | Local `./spark` (bitkit-docker) | +| --- | --- | --- | +| Use for | Quick checks, physical phones, two-device Spark payments | Lightning to or from an outside node, Move to Spark with a channel, emergency exits, offline E2E | +| Lightning network | None. Builds pay each other only through Spark's provider | Alice, a Lightning node with a channel to the SSP | +| Chain | Lightspark's own | bitkit-docker's local regtest (`spark-bitcoind` peers with `bitcoind`) | +| Funding | Faucet | `./spark pay`, `./spark send` | +| Docs | `scripts/spark-regtest-esplora.py`, `scripts/spark-regtest-fund.py` (headers) | `bitkit-docker/docs/spark-regtest.md` | + +Read the named docs and script headers for details. The steps below are what is not obvious from them. + +## Lightspark hosted regtest + +1. A dev build connects with no key. Without `ESPLORA_URL`, Savings stays on Blocktank's staging chain, so Spark never + sees a Transfer to Spending deposit and the Transfer Unavailable sheet shows. +2. Put Savings on Spark's chain: run `python3 scripts/spark-regtest-esplora.py --port 3999` (`--bind 0.0.0.0` for a + phone), then build with `ESPLORA_URL=http://10.0.2.2:3999 ./gradlew assembleDevDebug` (a phone uses the host's LAN + IP). `ESPLORA_URL` is read from the environment, a Gradle property or `local.properties`. +3. Fund: + - Web faucet: https://app.lightspark.com/regtest-faucet, at most 50,000 sats per deposit. The user submits it in a + browser. + - Script: `SPARK_REGTEST_MNEMONIC=… uv run scripts/spark-regtest-fund.py [sats]`. The mnemonic is a + GitHub secret; ask the user, never print it. + - Spark's deposit address is on Settings › Advanced › Lightning Connections › Spark. Fund it to fill Spending + directly, or fund Savings to test Transfer to Spending. +4. Lightspark mines about once a minute. A deposit is claimed after 1 confirmation. + +iOS has no `ESPLORA_URL`, so an iOS build on the hosted regtest can only fund Spark's deposit address directly. + +## Local `./spark` stack + +Run from a bitkit-docker checkout on `main`. The first `./spark up` builds Rust and Go images and generates operator +keys; expect a long wait. + +```bash +./spark up +# Android, from bitkit-android +SPARK_LOCAL_CONFIG_B64="$(../bitkit-docker/spark config --base64)" \ +SPARK_LOCAL_CHAIN_URL=http://127.0.0.1:23090/api ./gradlew assembleDevDebug +for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$port; done +``` + +- Both settings are environment variables only, read at build time. Unset, the build uses the hosted regtest. +- Mine with `./spark mine`, not `./bitcoin-cli mine`: only `spark-bitcoind` relays Spark's v3 packages. +- iOS reads the two settings only in a Debug regtest build that runs as E2E (`E2E_BUILD`, or launch env `E2E=true`) + with `E2E_BACKEND=local` (`Env.localSparkSettings`). bitkit-e2e-tests' `README.md` (Spark tests on local regtest) + builds both apps that way with `./scripts/local-backend spark-env`. +- A physical phone needs `SPARK_PUBLIC_HOST= ./spark up` or `adb reverse` over USB or wireless adb. + +## Mainnet builds + +Mainnet needs `BREEZ_API_KEY`, read from the environment, a Gradle property, `local.properties` or the macOS keychain +item `BREEZ_API_KEY` (`README.md`, Build secrets). Regtest needs none. Never print the key. diff --git a/README.md b/README.md index 5764bc4c2c..6f8caf0951 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ Reports are generated in: `app/build/reports/detekt/`. The repo ships Claude Code plugins under `.claude/plugins/` to give Claude domain-specific skills for local development: - [**blocktank-api**](.claude/plugins/blocktank-api/README.md) — `/lsp` skill for Blocktank staging's regtest tools (mine, deposit, pay invoice) and lookups of existing orders. +- [**spark-regtest**](.claude/plugins/spark-regtest/README.md) — build, fund and pay on Spark's regtest, hosted by Lightspark or local through bitkit-docker's `./spark`. Install or update all bundled plugins with: @@ -271,6 +272,7 @@ Destructive operations like `rm -rf`, `git commit`, and `git push` still require Claude Code plugins provide specialized skills for development workflows. See [`.claude/plugins/`](.claude/plugins/) for available plugins. - [blocktank-api](.claude/plugins/blocktank-api/README.md) — Blocktank staging regtest tools and order lookups +- [spark-regtest](.claude/plugins/spark-regtest/README.md) — Spark regtest builds and funding ## License From 4a7d080f47d563119e397075d3b8cbbddf819e7f Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 09:44:20 -0300 Subject: [PATCH 02/12] docs: fix spark-regtest skill after review Co-Authored-By: Claude Opus 5.5 --- .../skills/spark-regtest/SKILL.md | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index 67f7807610..62d06e8e3f 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -3,8 +3,9 @@ name: spark-regtest description: > This skill should be used when running a Bitkit dev build on Spark's regtest: building it for Spark, funding Savings or the Spark (Spending) balance, paying between dev builds, Move to Spark, - or Spark emergency exit tests. Triggers: "spark regtest", "fund spark", "spark faucet", - "ESPLORA_URL", "SPARK_LOCAL_CONFIG_B64", "./spark", "Lightspark regtest", "BREEZ_API_KEY". + or Spark emergency exit tests. Triggers: "spark regtest", "local spark", "fund spark", + "spark faucet", "spark deposit address", "Transfer Unavailable", "ESPLORA_URL", + "SPARK_LOCAL_CONFIG_B64", "./spark", "Lightspark regtest". version: 0.1.0 --- @@ -15,8 +16,8 @@ staging regtest (`stag0.blocktank.to`). Coins and Lightning payments never cross | | Lightspark hosted (default) | Local `./spark` (bitkit-docker) | | --- | --- | --- | -| Use for | Quick checks, physical phones, two-device Spark payments | Lightning to or from an outside node, Move to Spark with a channel, emergency exits, offline E2E | -| Lightning network | None. Builds pay each other only through Spark's provider | Alice, a Lightning node with a channel to the SSP | +| Use for | Quick checks, physical phones, two-device Spark payments | Lightning to or from a node you control, Move to Spark with a channel, emergency exits, offline E2E | +| Lightning | Only through Lightspark's provider; no node you control | Alice, a Lightning node with a channel to the provider | | Chain | Lightspark's own | bitkit-docker's local regtest (`spark-bitcoind` peers with `bitcoind`) | | Funding | Faucet | `./spark pay`, `./spark send` | | Docs | `scripts/spark-regtest-esplora.py`, `scripts/spark-regtest-fund.py` (headers) | `bitkit-docker/docs/spark-regtest.md` | @@ -25,43 +26,47 @@ Read the named docs and script headers for details. The steps below are what is ## Lightspark hosted regtest -1. A dev build connects with no key. Without `ESPLORA_URL`, Savings stays on Blocktank's staging chain, so Spark never - sees a Transfer to Spending deposit and the Transfer Unavailable sheet shows. -2. Put Savings on Spark's chain: run `python3 scripts/spark-regtest-esplora.py --port 3999` (`--bind 0.0.0.0` for a - phone), then build with `ESPLORA_URL=http://10.0.2.2:3999 ./gradlew assembleDevDebug` (a phone uses the host's LAN - IP). `ESPLORA_URL` is read from the environment, a Gradle property or `local.properties`. +1. A dev build connects with no key. Without `ESPLORA_URL`, Savings stays on Blocktank's staging chain, so the app + shows the Transfer Unavailable sheet instead of Transfer to Spending (`Env.sparkSharesNodeChain`). +2. Put Savings on Spark's chain: run `python3 scripts/spark-regtest-esplora.py --port 3999`, then build with + `ESPLORA_URL=http://10.0.2.2:3999 ./gradlew assembleDevDebug`. + - `ESPLORA_URL` has the same sources as `BREEZ_API_KEY` (environment, Gradle property, `local.properties`, keychain) + and applies to the dev flavor only. + - The proxy stops after `--max-seconds` (default 3 h). The build then loses its chain; restart the proxy. + - A phone: `adb reverse tcp:3999 tcp:3999` with `ESPLORA_URL=http://127.0.0.1:3999`, or `--bind 0.0.0.0` with the + host's LAN IP. 3. Fund: - - Web faucet: https://app.lightspark.com/regtest-faucet, at most 50,000 sats per deposit. The user submits it in a + - Web faucet: https://app.lightspark.com/regtest-faucet, up to 50,000 sats per deposit. The user submits it in a browser. - Script: `SPARK_REGTEST_MNEMONIC=… uv run scripts/spark-regtest-fund.py [sats]`. The mnemonic is a GitHub secret; ask the user, never print it. - Spark's deposit address is on Settings › Advanced › Lightning Connections › Spark. Fund it to fill Spending directly, or fund Savings to test Transfer to Spending. -4. Lightspark mines about once a minute. A deposit is claimed after 1 confirmation. - -iOS has no `ESPLORA_URL`, so an iOS build on the hosted regtest can only fund Spark's deposit address directly. +4. Lightspark mines about once a minute. Spark claims a deposit after 3 confirmations unless an Instant transfer claims + it early. ## Local `./spark` stack -Run from a bitkit-docker checkout on `main`. The first `./spark up` builds Rust and Go images and generates operator -keys; expect a long wait. +Run `./spark up` from a bitkit-docker checkout on `main`. The app reads the local settings only in a debug, regtest, +local-E2E build (`Env.localSparkSettings`), so the build needs `E2E=true` (`E2E_BACKEND` defaults to `local`). Without +it, the build silently stays on the hosted regtest. ```bash -./spark up -# Android, from bitkit-android -SPARK_LOCAL_CONFIG_B64="$(../bitkit-docker/spark config --base64)" \ +E2E=true SPARK_LOCAL_CONFIG_B64="$(../bitkit-docker/spark config --base64)" \ SPARK_LOCAL_CHAIN_URL=http://127.0.0.1:23090/api ./gradlew assembleDevDebug for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$port; done ``` -- Both settings are environment variables only, read at build time. Unset, the build uses the hosted regtest. +- `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. +- On Android the local stack turns off Transfer to Spending and exit fees paid from Savings + (`Env.sparkSharesNodeChain`). Fund Spark with `./spark pay` or `./spark send` to its deposit address, and pay exit + funding with `./spark send`. iOS allows both when its URLs match the fixture. +- A deposit is claimed after 1 block here. - Mine with `./spark mine`, not `./bitcoin-cli mine`: only `spark-bitcoind` relays Spark's v3 packages. -- iOS reads the two settings only in a Debug regtest build that runs as E2E (`E2E_BUILD`, or launch env `E2E=true`) - with `E2E_BACKEND=local` (`Env.localSparkSettings`). bitkit-e2e-tests' `README.md` (Spark tests on local regtest) - builds both apps that way with `./scripts/local-backend spark-env`. -- A physical phone needs `SPARK_PUBLIC_HOST= ./spark up` or `adb reverse` over USB or wireless adb. - -## Mainnet builds +- A phone over adb: set `E2E_LOCAL_HOST=127.0.0.1` and keep the `adb reverse` loop. Over the LAN: start with + `SPARK_PUBLIC_HOST= ./spark up`, and build with `E2E_LOCAL_HOST=` and + `SPARK_LOCAL_CHAIN_URL=http://:23090/api`. +- bitkit-e2e-tests' `README.md` (Spark tests on local regtest) runs the same stack from its pinned + `BITKIT_DOCKER_REVISION`, not your checkout. -Mainnet needs `BREEZ_API_KEY`, read from the environment, a Gradle property, `local.properties` or the macOS keychain -item `BREEZ_API_KEY` (`README.md`, Build secrets). Regtest needs none. Never print the key. +Regtest needs no `BREEZ_API_KEY`. For mainnet builds see `README.md`, "Breez API key". From 18f4c23feefa758c961755a2a036d9c66a96c40e Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 11:45:48 -0300 Subject: [PATCH 03/12] docs: blank saved esplora url in local spark build Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index 62d06e8e3f..8dc6a80454 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -52,12 +52,13 @@ local-E2E build (`Env.localSparkSettings`), so the build needs `E2E=true` (`E2E_ it, the build silently stays on the hosted regtest. ```bash -E2E=true SPARK_LOCAL_CONFIG_B64="$(../bitkit-docker/spark config --base64)" \ +ESPLORA_URL= E2E=true E2E_BACKEND=local SPARK_LOCAL_CONFIG_B64="$(../bitkit-docker/spark config --base64)" \ SPARK_LOCAL_CHAIN_URL=http://127.0.0.1:23090/api ./gradlew assembleDevDebug for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$port; done ``` - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. + `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. - On Android the local stack turns off Transfer to Spending and exit fees paid from Savings (`Env.sparkSharesNodeChain`). Fund Spark with `./spark pay` or `./spark send` to its deposit address, and pay exit funding with `./spark send`. iOS allows both when its URLs match the fixture. From 2b37459455b0d6e63b917186dc4266c26ec61ee8 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 11:45:48 -0300 Subject: [PATCH 04/12] docs: name the argument each spark funding command takes Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index 8dc6a80454..f959bf0e72 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -60,8 +60,8 @@ for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$p - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. - On Android the local stack turns off Transfer to Spending and exit fees paid from Savings - (`Env.sparkSharesNodeChain`). Fund Spark with `./spark pay` or `./spark send` to its deposit address, and pay exit - funding with `./spark send`. iOS allows both when its URLs match the fixture. + (`Env.sparkSharesNodeChain`). Fund Spark with `./spark send ` or + `./spark pay [sats]`, and pay exit funding with `./spark send`. iOS allows both when its URLs match the fixture. - A deposit is claimed after 1 block here. - Mine with `./spark mine`, not `./bitcoin-cli mine`: only `spark-bitcoind` relays Spark's v3 packages. - A phone over adb: set `E2E_LOCAL_HOST=127.0.0.1` and keep the `adb reverse` loop. Over the LAN: start with From 98119ab013a4ac18b8eaeea95bdad49bf9ec7694 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 11:45:48 -0300 Subject: [PATCH 05/12] docs: add two-device payment step to hosted spark regtest Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index f959bf0e72..ec7a258f26 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -44,6 +44,8 @@ Read the named docs and script headers for details. The steps below are what is directly, or fund Savings to test Transfer to Spending. 4. Lightspark mines about once a minute. Spark claims a deposit after 3 confirmations unless an Instant transfer claims it early. +5. Two-device payment: fund the payer's Spark balance, copy the invoice from Receive › Spending on the other dev build, + and pay it from the payer. It goes over Lightning through Lightspark's provider. ## Local `./spark` stack From 2df1a4f40b288481895aca05b77142a9450588e8 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 11:45:48 -0300 Subject: [PATCH 06/12] docs: reset saved electrum server for local spark stack Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index ec7a258f26..5bc30197d1 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -61,6 +61,8 @@ for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$p - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. +- An install that already chose an Electrum server keeps it. Use a fresh install, or Settings › Advanced › Electrum + Server › Reset To Default. - On Android the local stack turns off Transfer to Spending and exit fees paid from Savings (`Env.sparkSharesNodeChain`). Fund Spark with `./spark send ` or `./spark pay [sats]`, and pay exit funding with `./spark send`. iOS allows both when its URLs match the fixture. From 4dce3c331bb5f167767cecee226bd8f955fb3306 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 11:49:29 -0300 Subject: [PATCH 07/12] docs: uninstall dev build before local spark stack Co-Authored-By: Claude Opus 5.5 --- .../plugins/spark-regtest/skills/spark-regtest/SKILL.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index 5bc30197d1..b523e645d3 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -22,7 +22,8 @@ staging regtest (`stag0.blocktank.to`). Coins and Lightning payments never cross | Funding | Faucet | `./spark pay`, `./spark send` | | Docs | `scripts/spark-regtest-esplora.py`, `scripts/spark-regtest-fund.py` (headers) | `bitkit-docker/docs/spark-regtest.md` | -Read the named docs and script headers for details. The steps below are what is not obvious from them. +Sibling checkouts are assumed next to this repo (`../bitkit-docker`); from a worktree, use the main checkout's +siblings. Run `./spark` commands from bitkit-docker. Read the named docs and script headers for details. The steps below are what is not obvious from them. ## Lightspark hosted regtest @@ -61,8 +62,8 @@ for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$p - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. -- An install that already chose an Electrum server keeps it. Use a fresh install, or Settings › Advanced › Electrum - Server › Reset To Default. +- An existing dev install keeps the Electrum server saved in its settings, which includes the old default. Uninstall + first (backups are off, so nothing comes back), or use Settings › Advanced › Electrum Server › Reset To Default. - On Android the local stack turns off Transfer to Spending and exit fees paid from Savings (`Env.sparkSharesNodeChain`). Fund Spark with `./spark send ` or `./spark pay [sats]`, and pay exit funding with `./spark send`. iOS allows both when its URLs match the fixture. From 51b4a95bed9eddd86ae3286840662802584f46b4 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 12:24:18 -0300 Subject: [PATCH 08/12] docs: tap connect to host after electrum reset Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index b523e645d3..70d0d1d71e 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -63,7 +63,8 @@ for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$p - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. - An existing dev install keeps the Electrum server saved in its settings, which includes the old default. Uninstall - first (backups are off, so nothing comes back), or use Settings › Advanced › Electrum Server › Reset To Default. + first (backups are off, so nothing comes back), or use Settings › Advanced › Electrum Server › Reset To Default, then + Connect To Host (Reset only fills the form). - On Android the local stack turns off Transfer to Spending and exit fees paid from Savings (`Env.sparkSharesNodeChain`). Fund Spark with `./spark send ` or `./spark pay [sats]`, and pay exit funding with `./spark send`. iOS allows both when its URLs match the fixture. From 9f9197b1ea246e297d5457469879d9f174f9888c Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Tue, 24 Nov 2026 14:12:17 -0300 Subject: [PATCH 09/12] docs: stop the local spark build when spark config fails Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index 70d0d1d71e..afc5f822ff 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -55,11 +55,14 @@ local-E2E build (`Env.localSparkSettings`), so the build needs `E2E=true` (`E2E_ it, the build silently stays on the hosted regtest. ```bash -ESPLORA_URL= E2E=true E2E_BACKEND=local SPARK_LOCAL_CONFIG_B64="$(../bitkit-docker/spark config --base64)" \ +CFG="$(../bitkit-docker/spark config --base64)" && \ +ESPLORA_URL= E2E=true E2E_BACKEND=local SPARK_LOCAL_CONFIG_B64="$CFG" \ SPARK_LOCAL_CHAIN_URL=http://127.0.0.1:23090/api ./gradlew assembleDevDebug for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$port; done ``` +- `CFG=… &&` stops the build when `spark config` fails (stack not up, or the wrong `bitkit-docker` path). Inline, Gradle + would still run with an empty config, and Spark refuses to start. - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. - An existing dev install keeps the Electrum server saved in its settings, which includes the old default. Uninstall From c0303ac42c83e4d3b78624504eb8a3d503679619 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Wed, 25 Nov 2026 05:34:14 -0300 Subject: [PATCH 10/12] docs: skip adb reverse when the local spark build fails Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index afc5f822ff..9501c810e7 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -57,12 +57,12 @@ it, the build silently stays on the hosted regtest. ```bash CFG="$(../bitkit-docker/spark config --base64)" && \ ESPLORA_URL= E2E=true E2E_BACKEND=local SPARK_LOCAL_CONFIG_B64="$CFG" \ -SPARK_LOCAL_CHAIN_URL=http://127.0.0.1:23090/api ./gradlew assembleDevDebug +SPARK_LOCAL_CHAIN_URL=http://127.0.0.1:23090/api ./gradlew assembleDevDebug && \ for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$port; done ``` -- `CFG=… &&` stops the build when `spark config` fails (stack not up, or the wrong `bitkit-docker` path). Inline, Gradle - would still run with an empty config, and Spark refuses to start. +- The `&&` chain stops at the first failure. `spark config` fails when the stack is not up or the `bitkit-docker` path + is wrong; inline, Gradle would still run with an empty config, and Spark refuses to start. - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. - An existing dev install keeps the Electrum server saved in its settings, which includes the old default. Uninstall From 0a740d995c2bb5404764b5de1b2c0ffb535904df Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Wed, 25 Nov 2026 05:34:21 -0300 Subject: [PATCH 11/12] docs: keep the spark faucet mnemonic out of chat Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index 9501c810e7..155e3fcbaa 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -40,7 +40,7 @@ siblings. Run `./spark` commands from bitkit-docker. Read the named docs and scr - Web faucet: https://app.lightspark.com/regtest-faucet, up to 50,000 sats per deposit. The user submits it in a browser. - Script: `SPARK_REGTEST_MNEMONIC=… uv run scripts/spark-regtest-fund.py [sats]`. The mnemonic is a - GitHub secret; ask the user, never print it. + GitHub secret. Ask the developer to set it locally, or use the web faucet. Keep it out of chat. - Spark's deposit address is on Settings › Advanced › Lightning Connections › Spark. Fund it to fill Spending directly, or fund Savings to test Transfer to Spending. 4. Lightspark mines about once a minute. Spark claims a deposit after 3 confirmations unless an Instant transfer claims From 6e84867aea575e97ea826ad3804e3a0d3f09c107 Mon Sep 17 00:00:00 2001 From: jvsena42 Date: Wed, 25 Nov 2026 05:35:01 -0300 Subject: [PATCH 12/12] docs: stop the local spark build when spark up fails Co-Authored-By: Claude Opus 5.5 --- .claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md index 155e3fcbaa..2e584c469d 100644 --- a/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md +++ b/.claude/plugins/spark-regtest/skills/spark-regtest/SKILL.md @@ -55,14 +55,16 @@ local-E2E build (`Env.localSparkSettings`), so the build needs `E2E=true` (`E2E_ it, the build silently stays on the hosted regtest. ```bash +../bitkit-docker/spark up && \ CFG="$(../bitkit-docker/spark config --base64)" && \ ESPLORA_URL= E2E=true E2E_BACKEND=local SPARK_LOCAL_CONFIG_B64="$CFG" \ SPARK_LOCAL_CHAIN_URL=http://127.0.0.1:23090/api ./gradlew assembleDevDebug && \ for port in 23535 23536 23537 23049 23090 60001; do adb reverse tcp:$port tcp:$port; done ``` -- The `&&` chain stops at the first failure. `spark config` fails when the stack is not up or the `bitkit-docker` path - is wrong; inline, Gradle would still run with an empty config, and Spark refuses to start. +- The `&&` chain stops at the first failure. `spark up` can fail while a config from an earlier run survives, and + `spark config` fails when the stack is not up or the `bitkit-docker` path is wrong; inline, Gradle would still run with + an empty config, and Spark refuses to start. - `E2E=true` also points Savings at Electrum on `E2E_LOCAL_HOST:60001` (default `10.0.2.2`), bitkit-docker's chain. `ESPLORA_URL=` blanks a hosted proxy URL saved in another source, which Savings would otherwise use instead. - An existing dev install keeps the Electrum server saved in its settings, which includes the old default. Uninstall