Closed fusion44 closed 2 years ago
During startup the API will try to connect to Bitcoin Core and the Lightning Node. If it can't connect it will check every n
seconds (currently 2s) and connect when available. A new SSE event called "system_startup_info" is introduced. This event contains all startup status information during the startup procedure.
The old wallet_locked
event is no more, thus the Frontend will require a bit of a modification to account for the changes. This is much more robust and future proof than the hack we had before.
event: system_startup_info
data: {"bitcoin": "offline", "bitcoin_msg": "", "lightning": "offline", "lightning_msg": "Unable to connect to LND daemon, waiting..."}
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "offline", "lightning_msg": "Unable to connect to LND daemon, waiting..."}
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "locked", "lightning_msg": "Wallet locked, unlock it to enable full RPC access"}
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "done", "lightning_msg": ""}
event: system_startup_info
data: {"bitcoin": "done", "bitcoin_msg": "", "lightning": "bootstraping", "lightning_msg": "RPC not yet available"}
On low power systems like RaspiBlitz it can take longer to start up LND. Refactor the startup sequence to take this properly into account.
LND message sequence on startup:
Possible solution: Add a
_handle_lightning_ready
function before checking for wallet locked. Each lightning implementation should have their own checking function.