diff --git a/justfile b/justfile index 30014e5e..61433bf9 100644 --- a/justfile +++ b/justfile @@ -65,4 +65,7 @@ get-artifacts-size: scripts/check_artifacts_size.sh get-pools CHAIN: - scripts/deployment/extract_pools.sh -c {{CHAIN}} + scripts/deployment/extract_pools.sh -c {{CHAIN}} + +load CHAIN: + scripts/deployment/deploy_env/load_chain_env.sh {{CHAIN}} \ No newline at end of file diff --git a/scripts/deployment/deploy_env/load_chain_env.sh b/scripts/deployment/deploy_env/load_chain_env.sh new file mode 100755 index 00000000..eabee310 --- /dev/null +++ b/scripts/deployment/deploy_env/load_chain_env.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -e + +project_root_path=$(realpath "$0" | sed 's|\(.*\)/.*|\1|' | cd ../ | pwd) + +# Initializes chain env variables +function init_chain_env() { + if [ $# -eq 1 ]; then + local chain=$1 + else + echo "init_chain_env requires a chain" + exit 1 + fi + + # Define the environment type based on the chain argument + local env_type="mainnets" + if [[ $chain == *"-testnet" ]]; then + env_type="testnets" + fi + + source <(cat "$project_root_path"/scripts/deployment/deploy_env/"$env_type"/"${chain%-testnet}.env") + + if [[ $chain != "chihuahua" && $chain != "injective" && $chain != "injective-testnet" && $chain != "migaloo" && $chain != "migaloo-testnet" ]]; then + source <(cat "$project_root_path"/scripts/deployment/deploy_env/base.env) + fi +} + +init_chain_env $1 diff --git a/scripts/deployment/deploy_env/mainnets/migaloo.env b/scripts/deployment/deploy_env/mainnets/migaloo.env index eb2a5d49..167772bc 100644 --- a/scripts/deployment/deploy_env/mainnets/migaloo.env +++ b/scripts/deployment/deploy_env/mainnets/migaloo.env @@ -1,4 +1,4 @@ export CHAIN_ID="migaloo-1" export DENOM="uwhale" export BINARY="migalood" -export RPC="https://migaloo-rpc.polkachu.com:443" +export RPC="https://migaloo-rpc.polkachu.com:443" \ No newline at end of file