Skip to content

Commit

Permalink
Merge pull request #237 from alfonzii/feat/check-balance
Browse files Browse the repository at this point in the history
Check balances script
  • Loading branch information
Tibo-lg authored Oct 15, 2024
2 parents 0d16b4b + 292adcf commit c8ec7bd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/check_balances.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Locate bitcoin-cli
bitcoincli=$(command -v bitcoin-cli)

# Define RPC options
opts=( -rpcuser="testuser" -rpcpassword="lq6zequb-gYTdF2_ZEUtr8ywTXzLYtknzWU4nV8uVoo=" -regtest -named)

# Check and print balance of alice wallet
aliceBalance=$($bitcoincli "${opts[@]}" -rpcwallet=alice getbalance)
echo "Alice's balance: ${aliceBalance} BTC"

# Check and print balance of bob wallet
bobBalance=$($bitcoincli "${opts[@]}" -rpcwallet=bob getbalance)
echo "Bob's balance: ${bobBalance} BTC"

0 comments on commit c8ec7bd

Please sign in to comment.