2021-01-23 09:20:17 -08:00
|
|
|
#!/usr/bin/env bash
|
2020-11-19 03:53:19 -08:00
|
|
|
# This script submits a guardian set update using the VAA injection admin command.
|
|
|
|
# First argument is node to submit to. Second argument is current set index.
|
|
|
|
set -e
|
|
|
|
|
|
|
|
node=$1
|
|
|
|
idx=$2
|
|
|
|
path=/tmp/new-guardianset.prototxt
|
|
|
|
sock=/tmp/admin.sock
|
|
|
|
|
|
|
|
# Create a no-op update that sets the same 1-node guardian set again.
|
2021-01-19 04:01:45 -08:00
|
|
|
kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand template guardian-set-update --num=1 --idx=${idx} $path
|
2020-11-19 03:53:19 -08:00
|
|
|
|
|
|
|
# Verify and print resulting result. The digest incorporates the current time and is NOT deterministic.
|
2021-01-19 04:01:45 -08:00
|
|
|
kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-verify $path
|
2020-11-19 03:53:19 -08:00
|
|
|
|
|
|
|
# Submit to node
|
2021-01-19 04:01:45 -08:00
|
|
|
kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-inject --socket $sock $path
|