-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chain activation: avoid misfiring (#601)
* chain activation: avoid misfiring when activate job gets a successful RPC response for the first time, it should not repeat the query; instead, just parse the output again and check whether the level is zero. This way, if the second rpc query fails, it will just restart the job instead of passing silently, resulting in a non-activated chain stuck at level 0, as happened on Mondaynet today. * fix helm tests
- Loading branch information
1 parent
9424957
commit 5ec120a
Showing
2 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
CLIENT="/usr/local/bin/octez-client --endpoint http://tezos-node-rpc:8732" | ||
|
||
until $CLIENT rpc get /chains/main/blocks/head/header | grep '"level":'; do | ||
OUTPUT="" | ||
until OUTPUT=$($CLIENT rpc get /chains/main/blocks/head/header) && echo "$OUTPUT" | grep '"level":'; do | ||
sleep 2 | ||
done | ||
|
||
set -x | ||
set -o pipefail | ||
if ! $CLIENT rpc get /chains/main/blocks/head/header | grep '"level": 0,'; then | ||
if ! echo "$OUTPUT" | grep '"level": 0,'; then | ||
echo "Chain already activated, considering activation successful and exiting" | ||
exit 0 | ||
fi | ||
|
||
echo Activating chain: | ||
$CLIENT -d /var/tezos/client --block \ | ||
genesis activate protocol \ | ||
{{ .Values.activation.protocol_hash }} \ | ||
with fitness 1 and key \ | ||
$( cat /etc/tezos/activation_account_name ) \ | ||
and parameters /etc/tezos/parameters.json 2>&1 | head -200 | ||
$CLIENT -d /var/tezos/client --block \ | ||
genesis activate protocol \ | ||
{{ .Values.activation.protocol_hash }} \ | ||
with fitness 1 and key \ | ||
$( cat /etc/tezos/activation_account_name ) \ | ||
and parameters /etc/tezos/parameters.json 2>&1 | head -200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters