Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay starting services till bitcoind is ready #75

Closed
theborakompanioni opened this issue Nov 2, 2022 · 0 comments · Fixed by #76
Closed

Delay starting services till bitcoind is ready #75

theborakompanioni opened this issue Nov 2, 2022 · 0 comments · Fixed by #76
Assignees
Labels
bug Something isn't working

Comments

@theborakompanioni
Copy link
Collaborator

theborakompanioni commented Nov 2, 2022

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

  1. Install Jam on Umbrel
  2. Power down the system and reboot only after some blocks have been mined
  3. 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…'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant