Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chain activation: avoid misfiring #601

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions charts/tezos/scripts/chain-initiator.sh
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
17 changes: 9 additions & 8 deletions test/charts/private-chain.expect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1620,24 +1620,25 @@ spec:
- |
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 \
PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY \
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 \
PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY \
with fitness 1 and key \
$( cat /etc/tezos/activation_account_name ) \
and parameters /etc/tezos/parameters.json 2>&1 | head -200

envFrom:
env:
Expand Down
Loading