From 80e80f9e8ea8f9d16ea8f6a086026eb1ff335b73 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Fri, 24 Oct 2025 13:37:17 +0100 Subject: [PATCH] add script to query stake addr info --- scripts/query/stake-info.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/query/stake-info.sh diff --git a/scripts/query/stake-info.sh b/scripts/query/stake-info.sh new file mode 100755 index 0000000..350858e --- /dev/null +++ b/scripts/query/stake-info.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Define directories +keys_dir="./keys" + +# Get the script's directory +script_dir=$(dirname "$0") + +# Get the container name from the get-container script +container_name="$("$script_dir/../helper/get-container.sh")" + +if [ -z "$container_name" ]; then + echo "Failed to determine a running container." + exit 1 +fi + +echo "Using running container: $container_name" + +# Function to execute cardano-cli commands inside the container +container_cli() { + docker exec -ti $container_name cardano-cli "$@" +} + +# Check if you have a address created +if [ ! -f "$keys_dir/payment.addr" ]; then + echo "Please generate some keys and addresses before querying funds." + echo "Exiting." + exit 0 +fi + +echo "Querying Stake Account info for your address: $(cat $keys_dir/stake.addr)" + +container_cli conway query stake-address-info \ + --address "$(cat $keys_dir/stake.addr)" \ + --out-file /dev/stdout