Issues with Bitcoinlib regtest

1 reply 458 views
RogueGangMember
Posts: 6 · Reputation: 132
#1Dec 12, 2020, 08:51 PM
I'm trying to figure out how to load a regtest wallet made with bitcoinlib using a specific client, but I'm kinda lost on how this works or if it's even possible. Here's what I've got: >>> 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 really need is to somehow set the wallet to use the bitcoind_client that I just created. Any ideas?
2 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#2Dec 12, 2020, 10:38 PM
bitcoinlib has a documentary on how to do that: https://bitcoinlib.readthedocs.io/en/latest/source/_static/manuals.setup-bitcoind-connection.html 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.
3 Reply Quote Share

Related topics