Author

Topic: Bitcoinlib regtest issues (Read 56 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
August 17, 2024, 11:16:30 PM
#2
bitcoinlib has a documentary on how to do that: https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bitcoind-connection.html

>>>  # Connect to a local regtest daemon
>>> base_url = 'http://user:[email protected]:18443'
But since you're using the deprecated RPC username and password, set "rpcuser" and "rpcpassword" in your bitcoin.conf file
instead of the "rpcauth" in the provided example in their doc.
Don't forget to restart Bitcoin Core whenever you want to apply the new config in your conf file.
newbie
Activity: 6
Merit: 26
August 17, 2024, 07:56:45 PM
#1
Im looking for a way to load a regtest wallet created by bitcoinlib using a specified client but i don't know exactly how this works or even if i can. Here's my code:

>>> from bitcoinlib.wallets import wallet_create_or_open, Wallet
>>> from bitcoinlib.services.bitcoind import BitcoindClient
>>>
>>>  # Connect to a local regtest daemon
>>> base_url = 'http://user:[email protected]:18443'
>>> bitcoind_client = BitcoindClient(network='regtest', base_url=base_url)
>>>
>>> # Create or load a wallet
>>> wallet_name = 'my_regtest_wallet'
>>> wallet = wallet_create_or_open(wallet_name, network='regtest', witness_type='segwit')

What i want is to "tell" the wallet to use the bitcoind_client i provided.
Any help is welcomed!
Jump to: