refactor: collapse fakewallet/regtest wrappers into single dev CLI

Replaces the two parallel scripts (fakewallet.sh, regtest.sh) with one
modules/dev-env/scripts/dev.sh — `dev up [--fakewallet|--regtest]`,
plus `down|logs|shell`. Default mode is fakewallet (no docker, no
chains, instant), matching what the prior scaffold did with two scripts
but giving consumers one command and one verb-set to learn.

Drops the now-redundant `lnbits.backend` enum and `features.fakewallet`
option from core.nix. Backend selection is the dev CLI's runtime
concern; a NixOS-level option would be a second knob that can disagree
with the CLI flag at runtime. `lnbits.{host,port}` stay (bind addr,
useful to docs and any later service path). `features.regtest` stays
(gates docker engine installation — consumers who'll never use the
regtest mode shouldn't pay for the container engine).

Strips modules/lnbits.nix entirely. The dev CLI runs lnbits ad-hoc; if
a NixOS-managed lnbits service becomes a real ask later, re-add a
focused module then.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-25 12:56:05 +02:00
commit 94a7c5f97c
7 changed files with 66 additions and 157 deletions

View file

@ -1,36 +0,0 @@
#!/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