1200wd / bitcoinlib

Bitcoin and other Cryptocurrencies Library for Python. Includes a fully functional wallet, Mnemonic key generation and management and connection with various service providers to receive and send blockchain and transaction information.
http://bitcoinlib.readthedocs.io/
GNU General Public License v3.0
613 stars 204 forks source link

local bitcoind provider, getting error "No wallet is loaded." #389

Closed krupan closed 8 months ago

krupan commented 8 months ago
  1. Using BitcoinLib 0.6.14

  2. Added a provider for my bitcoind instance in providers.json:

  "bitcoind": {
    "provider": "bitcoind",
    "network": "bitcoin",
    "client_class": "BitcoindClient",
    "provider_coin_id": "",
    "url": "http://bitcoinrpc:<password>@localhost:8332",
    "api_key": "",
    "priority": 11,
    "denominator": 100000000,
    "network_overrides": null
  },
  1. Added rpcuser and rpcpassword to my bitcoin.conf file.

  2. Added =debug=rpc= to my bitcoin.conf file.

  3. Restarted bitcoind

Using clw and running this command:

clw <wallet name> --update-transactions

I can see the rpc queries in the bitcoind log debug.log file. However, when it gets to this query:

+begin_example

2024-03-22T06:04:45Z [rpc] ThreadRPCServer method=getaddressinfo user=bitcoinrpc

+end_example

It fails in bitcoinlib with this message (which I can only see if I add a breakpoint() to services.py on line 193, like so:

                _logger.debug("Executed method %s from provider %s" % (method, sp))
                self.resultcount += 1
            except Exception as e:
###  added breakpoint here ###
                breakpoint()

                if not isinstance(e, AttributeError):
                    try:
                        err = e.msg
                    except AttributeError:
                        err = e
                    self.errors.update(
                        {sp: err}
                    )

and step through the code, otherwise the error message gets swallowed.

+begin_example

bitcoinlib.services.authproxy.JSONRPCException: -18: No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)

+end_example