get-lnbits-key.sh targets deprecated LNbits API (pre-0.12) — wallet creation fails on fresh installs #19
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?
Context
scripts/bitcoin-ln-node/get-lnbits-key.shattempts to create a Timmy wallet via the LNbits superuser API (POST /api/v1/walletwithX-Api-Key: <superuser-id>). This pattern was removed in LNbits 0.12 (released late 2024). LNbits 0.12+ uses a different account model managed via/admin, and the SQLite superuser-detection fallback reads the wrong schema on 0.12+.The script silently falls through to manual instructions without telling the user why automation failed.
Requirements
GET /api/v1/health(returnsserver_version)$LNBITS_LOCAL/admin, create a wallet, and paste the admin keyLNBITS_URLandLNBITS_API_KEYtemplate lines at the end regardless of pathAcceptance Criteria
get-lnbits-key.shon LNbits 0.12+ prints the admin UI path clearly, not a silent failureget-lnbits-key.shon LNbits < 0.12 still works via the old APILNBITS_API_KEYandLNBITS_URLtemplate lines are always printedFiles
scripts/bitcoin-ln-node/get-lnbits-key.shscripts/bitcoin-ln-node/setup.sh(add version compatibility note)PR #53 created.
The root cause: the script used
/api/v1/healthfor both reachability testing and version detection. Since that endpoint only exists on LNbits 0.12+, pre-0.12 instances were incorrectly reported as "not reachable" instead of falling through to the legacy superuser API path.Fix separates reachability (GET /) from version detection (/api/v1/health). When the health endpoint is absent, the script now correctly assumes pre-0.12 and tries the superuser wallet creation flow.