Bitcoin Forum
November 12, 2024, 11:49:03 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoinlib regtest issues  (Read 55 times)
lucas jeffrey (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 26


View Profile
August 18, 2024, 12:56:45 AM
 #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:password@127.0.0.1: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!
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6372


Self-proclaimed Genius


View Profile
August 18, 2024, 04:16:30 AM
 #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:password@127.0.0.1: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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!