Disaster Recovery from a Failure on Global Synchronizer
1
export NAME=<name of the validator>
export PASSWORD=<password for wallet>
export KEYCLOAK_URL=<keycloak url>
export REALM=<keycloak realm for catalyst>2
curl --location "${KEYCLOAK_URL}/auth/realms/${REALM}/protocol/openid-connect/token" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=password" \
--data-urlencode "client_id=${NAME}-wallet-ui" \
--data-urlencode "username=${NAME}_walletuser" \
--data-urlencode "password=${PASSWORD}" > token.json3
export TOKEN=$(jq -r .access_token token.json)4
export WALLET_URL=<url of the validator wallet application>
export TIMESTAMP=<timestamp on the same format as the logs>
curl -sSLf "${WALLET_URL}/api/validator/v0/admin/domain/data-snapshot?timestamp=${TIMESTAMP}&force=true" \
-X GET \
-H "authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" > dump_response.json5
jq '.data_snapshot' dump_response.json > data_snapshot.json6
export NAMESPACE=<namespace of the validator>
export PODNAME=<pod of validator>
kubectl cp data_snapshot.json ${NAMESPACE}/${PODNAME}:/domain-upgrade-dump/domain_migration_dump.json7
export LOCAL_DUMP_MD5SUM=$(md5sum data_snapshot.json)
export PODS_DUMP_MD5SUM=$(kubectl -n "${NAMESPACE}" exec -it ${PODNAME} -- md5sum /domain-upgrade-dump/domain_migration_dump.json)
if [ "$(echo $LOCAL_DUMP_MD5SUM | awk '{print $1}')" = "$(echo $PODS_DUMP_MD5SUM | awk '{print $1}')" ]; then
echo 'MD5SUM checksums are equal.'
else
echo 'MD5SUM checksums are not equal! Check the file copied is correct.'
fi8
Last updated
Was this helpful?