[Infra] Fix LNbits API version compatibility (0.12+ wallet creation) #66
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & Why
scripts/bitcoin-ln-node/get-lnbits-key.shuses the pre-0.12 LNbits superuser API to create a wallet (POST /api/v1/walletwithX-Api-Key: <superuser-id>). This endpoint was removed in LNbits 0.12 (released late 2024). On a fresh install with modern LNbits, the script silently falls through to the manual instructions section without explaining why automation failed, leaving the operator confused.Done looks like
http://localhost:5000/admin) and what to do there, instead of silently failingLNBITS_URLandLNBITS_API_KEYexport lines are always printed at the end as a template to paste into Replit secretsOut of scope
setup.shbeyond adding a version compatibility noteTasks
GET /api/v1/health, parseserver_versionfrom JSON. Print detected version. If endpoint unreachable, print warning and fall through.export LNBITS_URL=...andexport LNBITS_API_KEY=...template lines.Relevant files
scripts/bitcoin-ln-node/get-lnbits-key.shscripts/bitcoin-ln-node/setup.sh