-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Expected behavior
When bitcoind is not yet ready accepting rpc commands, all services should start normally.
Actual behavior
When bitcoind is not yet ready, jmwalletd and obwatcher fail to start.
Steps to reproduce the problem
- Install Jam on Umbrel
- Power down the system and reboot only after some blocks have been mined
- Power on and see services failing to start
Additional context
bitcoind is going through a warmup phase, in which it does not yet accept rpc commands.
See https://github.com/bitcoin/bitcoin/blob/a1fff275e7b6e01a46ad248c3b4e220091c1e806/src/init.cpp#L1834
Till then, it will always respond with error code -28 and a status message, e.g.:
{"code": -28, "message": "Verifying blocks…"}There is a mechanism in place to wait for a ready file to be created (env var READY_FILE).
However, Umbrel does not support such a feature at the moment.
A possible solution is to wait for a successful response to getblockchaininfo - the first command jmwalletd is executing.
global_singleton.bc_interface = get_blockchain_interface_instance(
File "/src/jmclient/jmclient/configure.py", line 898, in get_blockchain_interface_instance
bc_interface = BitcoinCoreInterface(rpc, network,
File "/src/jmclient/jmclient/blockchaininterface.py", line 174, in __init__
blockchainInfo = self._rpc("getblockchaininfo", [])
File "/src/jmclient/jmclient/blockchaininterface.py", line 234, in _rpc
res = self.jsonRpc.call(method, args)
File "/src/jmclient/jmclient/jsonrpc.py", line 165, in call
raise JsonRpcError(response["error"])
jmclient.jsonrpc.JsonRpcError: {'code': -28, 'message': 'Verifying blocks…'}