|
| 1 | +#!/usr/bin/env bash |
| 2 | +# shellcheck disable=SC2031 |
| 3 | +set -euo pipefail |
| 4 | + |
| 5 | +[ -n "${DEBUG:-}" ] && set -x |
| 6 | +[ -z "${ENV:-}" ] && { echo "ENV var must be set"; exit 1; } |
| 7 | + |
| 8 | +SCRIPT_PATH=$(readlink -f "$0") |
| 9 | +SCRIPT_DIR=$(dirname "$SCRIPT_PATH") |
| 10 | + |
| 11 | +# shellcheck disable=SC1091 |
| 12 | +source "$SCRIPT_DIR/../bash-fns.sh" |
| 13 | + |
| 14 | +FUND_DELEGATE() { |
| 15 | + NAME="$1" |
| 16 | + SEND_ADDR="$2" |
| 17 | + |
| 18 | + read -p "Do you wish to fund $NAME [yY]? " -n 1 -r |
| 19 | + echo |
| 20 | + if [[ $REPLY =~ ^[Yy]$ ]]; then |
| 21 | + read -r -p "Enter in lovelace what the funding UTXO should be: " LOVELACE |
| 22 | + just fund-transfer "$ENV" "$SEND_ADDR" "$LOVELACE" |
| 23 | + fi |
| 24 | + echo |
| 25 | +} |
| 26 | + |
| 27 | +echo "In env $ENV, pool1 currently has UTXO of:" |
| 28 | +cardano-cli latest query utxo --address "$(just sops-decrypt-binary "secrets/groups/${ENV}1/no-deploy/${ENV}1-bp-a-1-owner-payment-stake.addr")" | jq |
| 29 | +echo |
| 30 | +FUND_DELEGATE "pool1" "$(just sops-decrypt-binary "secrets/groups/${ENV}1/no-deploy/${ENV}1-bp-a-1-owner-payment-stake.addr")" |
| 31 | + |
| 32 | +echo "In env $ENV, pool2 currently has UTXO of:" |
| 33 | +cardano-cli latest query utxo --address "$(just sops-decrypt-binary "secrets/groups/${ENV}2/no-deploy/${ENV}2-bp-b-1-owner-payment-stake.addr")" | jq |
| 34 | +echo |
| 35 | +FUND_DELEGATE "pool2" "$(just sops-decrypt-binary "secrets/groups/${ENV}2/no-deploy/${ENV}2-bp-b-1-owner-payment-stake.addr")" |
| 36 | + |
| 37 | +echo "In env $ENV, pool3 currently has UTXO of:" |
| 38 | +cardano-cli latest query utxo --address "$(just sops-decrypt-binary "secrets/groups/${ENV}3/no-deploy/${ENV}3-bp-c-1-owner-payment-stake.addr")" | jq |
| 39 | +echo |
| 40 | +FUND_DELEGATE "pool3" "$(just sops-decrypt-binary "secrets/groups/${ENV}3/no-deploy/${ENV}3-bp-c-1-owner-payment-stake.addr")" |
| 41 | + |
| 42 | +echo "In env $ENV, drep-0 currently has UTXO of:" |
| 43 | +cardano-cli latest query utxo --address "$(just sops-decrypt-binary "secrets/envs/${ENV}/drep/drep-0.addr")" | jq |
| 44 | +echo |
| 45 | +FUND_DELEGATE "drep-0" "$(just sops-decrypt-binary "secrets/envs/${ENV}/drep/drep-0.addr")" |
0 commit comments