From c4bf077636b3e4b25534c9b1534e1a5c17ab135c Mon Sep 17 00:00:00 2001 From: Padreug Date: Sun, 24 May 2026 23:03:11 +0200 Subject: [PATCH] chore: stub regtest.sh + fakewallet.sh dispatchers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both scripts are placeholders that document the intended dispatcher shape (up/down/logs/shell). fakewallet.sh is a deliberate no-op for symmetry — same muscle memory whether the backend is a docker stack or a constant. Co-Authored-By: Claude Opus 4.7 (1M context) --- modules/dev-env/scripts/fakewallet.sh | 38 +++++++++++++++++++++++++++ modules/dev-env/scripts/regtest.sh | 36 +++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100755 modules/dev-env/scripts/fakewallet.sh create mode 100755 modules/dev-env/scripts/regtest.sh diff --git a/modules/dev-env/scripts/fakewallet.sh b/modules/dev-env/scripts/fakewallet.sh new file mode 100755 index 0000000..e61852e --- /dev/null +++ b/modules/dev-env/scripts/fakewallet.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# fakewallet.sh — symmetric no-op for parity with regtest.sh. +# +# FakeWallet is the default LNbits backend. There is nothing to start, +# nothing to stop, nothing to log: LNbits with `LNBITS_BACKEND_WALLET_CLASS=FakeWallet` +# just runs. +# +# This wrapper exists purely so the dev experience is symmetric with +# the regtest stack: +# +# fakewallet up # no-op, prints reassurance +# fakewallet down # no-op, prints reassurance +# fakewallet logs # tails lnbits' own logs (not a backend's) +# fakewallet shell # no-op (no container to enter) +# +# Muscle memory wins. `regtest up` and `fakewallet up` mean the same +# thing — "make the chosen backend ready" — even when one is a docker +# stack and the other is a constant. + +set -euo pipefail + +# TODO(skeleton): wire the substantive variants in a later pass. +# `up` / `down` / `shell` stay no-ops by design; `logs` should +# `journalctl --user -u lnbits` (or whatever unit the lnbits module +# ends up declaring) so the dev still has a single place to look. + +case "${1:-up}" in + up | down | shell) + echo "FakeWallet is the default — nothing to start." + ;; + logs) + echo "fakewallet logs: TODO — tail the lnbits service log here." + ;; + *) + echo "Usage: fakewallet {up|down|logs|shell}" + exit 1 + ;; +esac diff --git a/modules/dev-env/scripts/regtest.sh b/modules/dev-env/scripts/regtest.sh new file mode 100755 index 0000000..efc7146 --- /dev/null +++ b/modules/dev-env/scripts/regtest.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# regtest.sh — wrapper around a Bitcoin/Lightning regtest docker stack. +# +# Mirrors the workflow of `lnbits/legend-regtest-enviroment` (LND + CLN +# + Eclair + bitcoind + electrs). Cloned to +# `${dev-env.root}/local/docker/regtest/` by the bootstrap script +# (later pass); this wrapper just dispatches `up` / `down` / `logs` / +# `shell` to the underlying docker-compose stack. +# +# Symmetric with fakewallet.sh so the dev experience reads the same +# whether you're on the default FakeWallet path or the regtest stack: +# +# regtest up # boot the regtest stack +# regtest down # tear it down +# regtest logs # tail compose logs +# regtest shell # drop into a node container +# +# Once `regtest up` is healthy, point LNbits at the appropriate +# backend (LndRestWallet / CoreLightningWallet) by flipping +# `lnbits-sensei.lnbits.backend` and rebuilding. + +set -euo pipefail + +# TODO(skeleton): replace with real dispatcher in the substantive pass. +# Intended shape: +# case "${1:-}" in +# up) docker compose -f "${REGTEST_DIR}/docker-compose.yml" up -d ;; +# down) docker compose -f "${REGTEST_DIR}/docker-compose.yml" down ;; +# logs) docker compose -f "${REGTEST_DIR}/docker-compose.yml" logs -f ;; +# shell) docker compose -f "${REGTEST_DIR}/docker-compose.yml" exec "${2}" sh ;; +# *) usage ;; +# esac + +echo "regtest: TODO — substantive implementation lands in a later pass." +echo "See modules/dev-env/scripts/regtest.sh for the intended dispatcher shape." +exit 0