Open oblak-be opened 12 months ago
It seems related to this: https://github.com/1200wd/bitcoinlib/commit/c6efbdeb137c9850ca5a10b01ed1b48e26589f79 fixed with this pull request: https://github.com/1200wd/bitcoinlib/pull/352
I'm not sure if the mentioned PR is addressing all the issues mentioned in the issue. I'm also facing the issue with the wrong chain param for the regtest network. The prefix_bech32
value must be bcrt
@mccwdev
https://github.com/bitcoin/bitcoin/blob/master/src/kernel/chainparams.cpp#L522
After some more testing and digging i found out that
When wallet.scan() is called in our case, BitcoindClient.gettransactions(wallet_address, '', 20) is called and fails
error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/.local/lib/python3.8/site-packages/bitcoinlib/services/bitcoind.py", line 223, in gettransactions
raise ClientError("Address %s not found in bitcoind wallet, use 'importpubkey' or 'importaddress' to add "
bitcoinlib.services.baseclient.ClientError: Address bcrt1qn... not found in bitcoind wallet, use 'importpubkey' or 'importaddress' to add address to wallet.
When changing res['iswatchonly'] = True
wallet.scan()
works and the balance is updated.
My workaround for now is pointing to a custom data directory as follows:
[locations]
# Location of BitcoinLib data, configuration and log files. Relative paths will be based in installation directory
data_dir=./data
In the BCL_CONFIG_FILE
and then fixing the networks.json
file for my own use case.
P.S. You need to replicate all the required files in the data directory: https://github.com/1200wd/bitcoinlib/tree/master/bitcoinlib/data
Dear maintainers/contributors
Bitcoinlib version
0.6.13
Goal:
Use Bitcoin regtest for platform code testing having the availability to provide test users with credit and run our platform tests.
Problem:
When opening an existing wallet, the
wallet.scan()
function fails with error:bitcoinlib.services.services.ServiceError: No successful response from any serviceprovider: ['bitcoind']
Steps taken:
providers.json
:network.jon
forregtest
:have a functinoing bitcoin-core node running in regtest mode on url from providers.json
create some wallets using bitcoinlib
mine some coins on bitcoin node and send some to a bitcoinlib wallet using bitcoin-cli on bitcoin node.
bitcoinlib commands:
Any help appreciated and thanks for the great project!