Tracked it down to this line:
|
private val serviceUri = uri"$scheme://$host:$port/wallet/" // wallet/ specifies to use the default bitcoind wallet, named "" |
Background story
Today I wanted to fix broken tests in simverse.
Here are my findings (note that I don't follow bitcoin core development that closely, so I may be missing something):
-
bitcoind used to create a default wallet with empty name. It seems to be no longer the case. Newly I have to first create some wallet via bitcoin-cli createwallet <name>. See my commit here.
-
eclair started failing with "bitcoind must have wallet support enabled", I double checked that my bitcoind really had wallet support enabled and started googling the issue. I found the same problem reported here.
-
I looked at the place where the error is raised and decided to investigate further.
-
I found out that the issue is that eclair has hardcoded empty wallet name.
-
bitcoind logic for selecting wallet for RPC request is implemented here.
Possible suggestions
-
BasicBitcoinJsonRPCClient should be configurable to allow wallet name selection (not sure how to propagate this configurability further)
-
By default BasicBitcoinJsonRPCClient should have unspecified name (which is different from empty string), If I understand the rpcwallet.cpp correctly, it would be more flexible in this case not to add "/wallet/" into endpoint url. Bitcoin RPC would then pick the only wallet it has loaded regardless of its name (or return an error about multi-wallet scenario via RPC_WALLET_NOT_SPECIFIED or an error about no-wallet scenario via RPC_METHOD_NOT_FOUND or any other error which could be implemented on bitcoind side in the future). This would be more flexible than assuming default wallet name to be empty string.
-
Secondary problem is that Setup.scala#L150 swallows original RPC error. Even if you didn't resolve points 1 or 2, the code should be updated to include original RPC error. It should not blindly return "bitcoind must have wallet support enabled" which may be misleading, because it assumes particular behaviour of bitcoind which may be subject of future changes.
Tracked it down to this line:
eclair/eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/rpc/BasicBitcoinJsonRPCClient.scala
Line 40 in 662e0c4
Background story
Today I wanted to fix broken tests in simverse.
Here are my findings (note that I don't follow bitcoin core development that closely, so I may be missing something):
bitcoind used to create a default wallet with empty name. It seems to be no longer the case. Newly I have to first create some wallet via
bitcoin-cli createwallet <name>. See my commit here.eclair started failing with
"bitcoind must have wallet support enabled", I double checked that my bitcoind really had wallet support enabled and started googling the issue. I found the same problem reported here.I looked at the place where the error is raised and decided to investigate further.
I found out that the issue is that eclair has hardcoded empty wallet name.
bitcoind logic for selecting wallet for RPC request is implemented here.
Possible suggestions
BasicBitcoinJsonRPCClient should be configurable to allow wallet name selection (not sure how to propagate this configurability further)
By default BasicBitcoinJsonRPCClient should have unspecified name (which is different from empty string), If I understand the rpcwallet.cpp correctly, it would be more flexible in this case not to add "/wallet/" into endpoint url. Bitcoin RPC would then pick the only wallet it has loaded regardless of its name (or return an error about multi-wallet scenario via
RPC_WALLET_NOT_SPECIFIEDor an error about no-wallet scenario viaRPC_METHOD_NOT_FOUNDor any other error which could be implemented on bitcoind side in the future). This would be more flexible than assuming default wallet name to be empty string.Secondary problem is that Setup.scala#L150 swallows original RPC error. Even if you didn't resolve points 1 or 2, the code should be updated to include original RPC error. It should not blindly return
"bitcoind must have wallet support enabled"which may be misleading, because it assumes particular behaviour of bitcoind which may be subject of future changes.