Skip to content

Commit 23345b6

Browse files
authored
add script to query stake addr info (#69)
1 parent d286fbd commit 23345b6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

scripts/query/stake-info.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
# Define directories
4+
keys_dir="./keys"
5+
6+
# Get the script's directory
7+
script_dir=$(dirname "$0")
8+
9+
# Get the container name from the get-container script
10+
container_name="$("$script_dir/../helper/get-container.sh")"
11+
12+
if [ -z "$container_name" ]; then
13+
echo "Failed to determine a running container."
14+
exit 1
15+
fi
16+
17+
echo "Using running container: $container_name"
18+
19+
# Function to execute cardano-cli commands inside the container
20+
container_cli() {
21+
docker exec -ti $container_name cardano-cli "$@"
22+
}
23+
24+
# Check if you have a address created
25+
if [ ! -f "$keys_dir/payment.addr" ]; then
26+
echo "Please generate some keys and addresses before querying funds."
27+
echo "Exiting."
28+
exit 0
29+
fi
30+
31+
echo "Querying Stake Account info for your address: $(cat $keys_dir/stake.addr)"
32+
33+
container_cli conway query stake-address-info \
34+
--address "$(cat $keys_dir/stake.addr)" \
35+
--out-file /dev/stdout

0 commit comments

Comments
 (0)