Skip to content

Commit

Permalink
Merge pull request #211 from bennyhodl/load-wallet-script
Browse files Browse the repository at this point in the history
Load wallet script if user restart bitcoin node
  • Loading branch information
Tibo-lg authored Apr 4, 2024
2 parents 926d3ad + 7d5b88f commit cf94bf5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/load_wallets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

bitcoincli=$(command -v bitcoin-cli)
opts=( -rpcuser="testuser" -rpcpassword="lq6zequb-gYTdF2_ZEUtr8ywTXzLYtknzWU4nV8uVoo=" -regtest )

$bitcoincli "${opts[@]}" loadwallet "alice"
$bitcoincli "${opts[@]}" loadwallet "bob"

aliceAddress=$($bitcoincli "${opts[@]}" -rpcwallet=alice getnewaddress bec32)
$bitcoincli "${opts[@]}" generatetoaddress 101 ${aliceAddress} &> /dev/null
bobAddress=$($bitcoincli "${opts[@]}" -rpcwallet=bob getnewaddress bec32)
$bitcoincli "${opts[@]}" generatetoaddress 201 ${bobAddress} &> /dev/null

0 comments on commit cf94bf5

Please sign in to comment.