chore: stub regtest.sh + fakewallet.sh dispatchers
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) <noreply@anthropic.com>
This commit is contained in:
parent
a21428e482
commit
c4bf077636
2 changed files with 74 additions and 0 deletions
38
modules/dev-env/scripts/fakewallet.sh
Executable file
38
modules/dev-env/scripts/fakewallet.sh
Executable file
|
|
@ -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
|
||||||
36
modules/dev-env/scripts/regtest.sh
Executable file
36
modules/dev-env/scripts/regtest.sh
Executable file
|
|
@ -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
|
||||||
Reference in a new issue