diff --git a/Tiltfile b/Tiltfile index ece907f53..3109e0fc5 100644 --- a/Tiltfile +++ b/Tiltfile @@ -222,7 +222,7 @@ if num_guardians >= 2: name = "guardian-set-update", resource_deps = guardian_resource_deps + ["guardian"], deps = ["scripts/send-vaa.sh", "clients/eth"], - cmd = './scripts/update-guardian-set.sh %s %s' % (num_guardians, webHost), + cmd = './scripts/update-guardian-set.sh %s %s %s' % (num_guardians, webHost, namespace), labels = ["guardian"], trigger_mode = trigger_mode, ) diff --git a/scripts/guardian-set-init.sh b/scripts/guardian-set-init.sh index bc2b64216..833ea0141 100755 --- a/scripts/guardian-set-init.sh +++ b/scripts/guardian-set-init.sh @@ -106,7 +106,7 @@ echo "REGISTER_BSC_TOKEN_BRIDGE_VAA=$bscTokenBridgeVAA" >> ./scripts/.env # copy the local .env file to the solana & terra dirs cp ./scripts/.env ./solana -cp ./scripts/.env ./terra +cp ./scripts/.env ./terra/tools echo "guardian set init complete!" diff --git a/scripts/update-guardian-set.sh b/scripts/update-guardian-set.sh index cab472dbb..1694c9581 100755 --- a/scripts/update-guardian-set.sh +++ b/scripts/update-guardian-set.sh @@ -4,7 +4,7 @@ set -e # wait for the guardians to establish networking -sleep 3 +sleep 20 newNumGuardians=$1 echo "new number of guardians: ${newNumGuardians}" @@ -12,6 +12,9 @@ echo "new number of guardians: ${newNumGuardians}" webHost=$2 echo "webHost ${webHost}" +namespace=$3 +echo "namespace ${namespace}" + # file & path to save governance VAA fileName=new-guardianset.prototxt localPath=./scripts/$fileName @@ -40,7 +43,7 @@ if [ ${currentNumGuardians} == ${newNumGuardians} ]; then fi echo "creating guardian set update governance message template prototext" -minikube kubectl -- exec -n wormhole guardian-0 -c guardiand -- /guardiand template guardian-set-update --num=${newNumGuardians} --idx=${currentIndex} > ${localPath} +minikube kubectl -- exec -n ${namespace} guardian-0 -c guardiand -- /guardiand template guardian-set-update --num=${newNumGuardians} --idx=${currentIndex} > ${localPath} # for i in $(seq ${newNumGuardians}) for i in $(seq ${currentNumGuardians}) @@ -50,10 +53,10 @@ do # create the governance guardian set update prototxt file in the container echo "created governance file for guardian-${guardianIndex}" - minikube kubectl -- cp ${localPath} wormhole/guardian-${guardianIndex}:${containerPath} -c guardiand + minikube kubectl -- cp ${localPath} ${namespace}/guardian-${guardianIndex}:${containerPath} -c guardiand # inject the guardian set update - minikube kubectl -- exec -n wormhole guardian-${guardianIndex} -c guardiand -- /guardiand admin governance-vaa-inject --socket $sock $containerPath + minikube kubectl -- exec -n ${namespace} guardian-${guardianIndex} -c guardiand -- /guardiand admin governance-vaa-inject --socket $sock $containerPath echo "injected governance VAA for guardian-${guardianIndex}" done diff --git a/terra/tools/deploy.js b/terra/tools/deploy.js index a16302451..f9eca929e 100644 --- a/terra/tools/deploy.js +++ b/terra/tools/deploy.js @@ -1,4 +1,4 @@ -require('dotenv').config({ path: "../.env" }); +import 'dotenv/config' import { LCDClient, MnemonicKey } from "@terra-money/terra.js"; import { StdFee, @@ -148,7 +148,7 @@ async function instantiate(contract, inst_msg) { const addresses = {}; const init_guardians = JSON.parse(process.env.INIT_SIGNERS) -if (!!init_guardians || init_guardians.length() == 0) { +if (!init_guardians || init_guardians.length === 0) { throw "failed to get initial guardians from .env file." }