Skip to content

Commit

Permalink
add new bolierplate to all scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryun1 committed Jan 1, 2025
1 parent aec47b5 commit 66d76d5
Show file tree
Hide file tree
Showing 31 changed files with 435 additions and 32 deletions.
15 changes: 14 additions & 1 deletion scripts/cc/authorize-hot-key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
keys_dir="./keys"
txs_dir="./txs/cc"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

echo "Authorizing hot key for the constitutional committee."
Expand Down
15 changes: 14 additions & 1 deletion scripts/cc/generate-cc-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Check if CC keys already exist
Expand Down
15 changes: 14 additions & 1 deletion scripts/cc/generate-new-hot-key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Generate hot CC keys
Expand Down
15 changes: 14 additions & 1 deletion scripts/cc/resign-cold-key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
keys_dir="./keys"
txs_dir="./txs/cc"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

echo "Resigning your CC cold key."
Expand Down
15 changes: 14 additions & 1 deletion scripts/cc/vote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
keys_dir="./keys"
txs_dir="./txs/cc"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Function to display script usage
Expand Down
15 changes: 14 additions & 1 deletion scripts/drep/create-and-register-multisig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
keys_dir="./keys"
txs_dir="./txs/drep"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Registering you as a drep
Expand Down
15 changes: 14 additions & 1 deletion scripts/drep/delegate-to-self.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
keys_dir="./keys"
txs_dir="./txs/drep"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

echo "Delegating your voting rights to your DRep ID."
Expand Down
15 changes: 14 additions & 1 deletion scripts/drep/retire.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
keys_dir="./keys"
txs_dir="./txs/drep"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Retiring you as a drep
Expand Down
15 changes: 14 additions & 1 deletion scripts/drep/vote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@
keys_dir="./keys"
txs_dir="./txs/drep"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Function to display script usage
Expand Down
15 changes: 14 additions & 1 deletion scripts/ga/hardfork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ METADATA_HASH="8a1bd37caa6b914a8b569adb63a0f41d8f159c110dc5c8409118a3f087fffb43"
keys_dir="./keys"
txs_dir="./txs/ga"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Building, signing and submitting an hardfork change governance action
Expand Down
15 changes: 14 additions & 1 deletion scripts/ga/info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@ METADATA_HASH="93106d082a93e94df5aff74f678438bae3a647dac63465fbfcde6a3058f41a1e"
keys_dir="./keys"
txs_dir="./txs/ga"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Building, signing and submitting an info governance action
Expand Down
15 changes: 14 additions & 1 deletion scripts/ga/new-committee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,22 @@ METADATA_HASH="01318fd6815453f35a4daac80cbbe3bf46c35dc070eb7dc817f26dfee5042eb8"
keys_dir="./keys"
txs_dir="./txs/ga"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Building, signing and submitting an new-committee change governance action
Expand Down
15 changes: 14 additions & 1 deletion scripts/ga/new-consitution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,22 @@ METADATA_HASH="4b2649556c838497ee2923bdff0f05b48fb2f0c3c5cceb450200f8bd6868ac5b"
keys_dir="./keys"
txs_dir="./txs/ga"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Building, signing and submitting an new-constitution change governance action
Expand Down
15 changes: 14 additions & 1 deletion scripts/ga/no-confidence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ METADATA_HASH="ab901c3aeeca631ee5c70147a558fbf191a4af245d8ca001e845d8569d7c38f9"
keys_dir="./keys"
txs_dir="./$txs_dir/ga"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Building, signing and submitting an no-confidence change governance action
Expand Down
15 changes: 14 additions & 1 deletion scripts/ga/parameter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ METADATA_HASH="3e6b1083a637a740d5b84bb6edf1a5119b81440b31ea84907311b6543ebd39eb"
keys_dir="./keys"
txs_dir="./txs/ga"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Building, signing and submitting an parameter change governance action
Expand Down
15 changes: 14 additions & 1 deletion scripts/ga/treasury.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,22 @@ METADATA_HASH="633e6f25fea857662d1542921f1fa2cab5f90a9e4cb51bdae8946f823e403ea8"
keys_dir="./keys"
txs_dir="./txs/ga"

# 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 sancho-node cardano-cli "$@"
docker exec -ti $container_name cardano-cli "$@"
}

# Building, signing and submitting an treasury governance action
Expand Down
Loading

0 comments on commit 66d76d5

Please sign in to comment.