test-injection.sh 1.0 KB

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. # This script submits a guardian set update using the VAA injection admin command.
  3. # First argument is node to submit to. Second argument is current set index.
  4. set -e
  5. node=$1
  6. idx=$2
  7. localPath=./scripts/new-guardianset.prototxt
  8. containerPath=/tmp/new-guardianset.prototxt
  9. sock=/tmp/admin.sock
  10. # Create a guardian set update VAA, pipe stdout to a local file.
  11. kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand template guardian-set-update --num=1 --idx=${idx} > ${localPath}
  12. # Copy the local VAA prototext to a pod's file system.
  13. kubectl cp ${localPath} wormhole/guardian-${node}:${containerPath} -c guardiand
  14. # Verify the contents of the VAA prototext file and print the result. The digest incorporates the current time and is NOT deterministic.
  15. kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-verify $containerPath
  16. # Submit to node
  17. kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-inject --socket $sock $containerPath