@@ -601,9 +601,12 @@ done
601
601
# Wait until pools are activated on the Cardano network
602
602
cat >> activate.sh << EOF
603
603
echo ">> Wait for Cardano pools to be activated"
604
- POOLS_ACTIVATION_WAIT_ROUNDS_MAX=20
605
- POOL_STAKE_RETRIEVAL_WAIT_ROUNDS_MAX=30
604
+ POOLS_ACTIVATION_WAIT_ROUND_DELAY=2
605
+ POOLS_ACTIVATION_WAIT_ROUNDS_MAX= \$ (echo "scale=0; 2 * $EPOCH_LENGTH * $SLOT_LENGTH / \$ POOLS_ACTIVATION_WAIT_ROUND_DELAY" | bc)
606
606
POOLS_ACTIVATION_WAIT_ROUNDS=1
607
+ POOL_STAKE_RETRIEVAL_WAIT_ROUND_DELAY=2
608
+ POOL_STAKE_RETRIEVAL_WAIT_ROUNDS_MAX=\$ POOLS_ACTIVATION_WAIT_ROUNDS_MAX
609
+
607
610
while true
608
611
do
609
612
POOLS=\$ (./pools.sh 2> /dev/null)
621
624
break
622
625
else
623
626
echo ">>>> Stakes are not retrievable for this pool yet... [attempt \$ POOL_STAKE_RETRIEVAL_WAIT_ROUNDS]"
624
- sleep 2
627
+ sleep \$ POOL_STAKE_RETRIEVAL_WAIT_ROUND_DELAY
625
628
fi
626
629
POOL_STAKE_RETRIEVAL_WAIT_ROUNDS=\$ (( \$ POOL_STAKE_RETRIEVAL_WAIT_ROUNDS + 1 ))
627
630
if [ "\$ POOL_STAKE_RETRIEVAL_WAIT_ROUNDS" -gt "\$ POOL_STAKE_RETRIEVAL_WAIT_ROUNDS_MAX" ] ; then
634
637
break
635
638
else
636
639
echo ">>>> Cardano pools are not activated yet... [attempt \$ POOLS_ACTIVATION_WAIT_ROUNDS]"
637
- sleep 2
640
+ sleep \$ POOLS_ACTIVATION_WAIT_ROUND_DELAY
638
641
fi
639
642
POOLS_ACTIVATION_WAIT_ROUNDS=\$ (( \$ POOLS_ACTIVATION_WAIT_ROUNDS + 1 ))
640
643
if [ "\$ POOLS_ACTIVATION_WAIT_ROUNDS" -gt "\$ POOLS_ACTIVATION_WAIT_ROUNDS_MAX" ] ; then
@@ -1001,7 +1004,7 @@ done
1001
1004
NODE_IX=0
1002
1005
for NODE in ${POOL_NODES} ; do
1003
1006
NODE_ID=$(( $NODE_IX + 1 ))
1004
- if [ ` expr $NODE_IX % 2` == 0 ]; then
1007
+ if [ ` expr $NODE_IX % 2` == 0 || -z " ${WITH_UNCERTIFIED_SIGNERS} " ]; then
1005
1008
# 50% of signers with key certification
1006
1009
cat >> ${NODE} /info.json << EOF
1007
1010
{
@@ -1193,17 +1196,16 @@ cat >> start-cardano.sh <<EOF
1193
1196
echo ">> Wait for Cardano network to be ready"
1194
1197
CARDANO_ACTIVATION_WAIT_ROUNDS_MAX=30
1195
1198
CARDANO_ACTIVATION_WAIT_ROUNDS=1
1199
+ CARDANO_ACTIVATION_WAIT_ROUND_DELAY=2
1196
1200
while true
1197
1201
do
1198
- EPOCH=\$ (CARDANO_NODE_SOCKET_PATH=node-bft1/ipc/node.sock ./cardano-cli query tip \\
1199
- --cardano-mode \\
1200
- --testnet-magic ${NETWORK_MAGIC} 2> /dev/null | jq .epoch | sed -e "s/null//" | sed -e "s/ //" | tr -d '\n')
1202
+ EPOCH=\$ (CARDANO_NODE_SOCKET_PATH=node-bft1/ipc/node.sock ./cardano-cli query tip --cardano-mode --testnet-magic ${NETWORK_MAGIC} 2> /dev/null | jq -r .epoch)
1201
1203
if [ "\$ EPOCH" != "" ] ; then
1202
1204
echo ">>>> Cardano network is ready!"
1203
1205
break
1204
1206
else
1205
1207
echo ">>>> Cardano network is not ready yet... [attempt \$ CARDANO_ACTIVATION_WAIT_ROUNDS]"
1206
- sleep 2
1208
+ sleep \$ CARDANO_ACTIVATION_WAIT_ROUND_DELAY
1207
1209
fi
1208
1210
CARDANO_ACTIVATION_WAIT_ROUNDS=\$ (( \$ CARDANO_ACTIVATION_WAIT_ROUNDS + 1 ))
1209
1211
if [ "\$ CARDANO_ACTIVATION_WAIT_ROUNDS" -gt "\$ CARDANO_ACTIVATION_WAIT_ROUNDS_MAX" ] ; then
@@ -1258,12 +1260,12 @@ done
1258
1260
cat >> start-mithril.sh << EOF
1259
1261
1260
1262
echo ">> Wait for Mithril signers to be registered"
1263
+ EPOCH_NOW=\$ (CARDANO_NODE_SOCKET_PATH=node-bft1/ipc/node.sock ./cardano-cli query tip --cardano-mode --testnet-magic ${NETWORK_MAGIC} 2> /dev/null | jq -r .epoch)
1261
1264
while true
1262
1265
do
1263
- EPOCH=\$ (CARDANO_NODE_SOCKET_PATH=node-bft1/ipc/node.sock ./cardano-cli query tip \\
1264
- --cardano-mode \\
1265
- --testnet-magic ${NETWORK_MAGIC} 2> /dev/null | jq .epoch | sed -e "s/null//" | sed -e "s/ //" | tr -d '\n')
1266
- if [ \$ EPOCH -ge 2 ] ; then
1266
+ EPOCH=\$ (CARDANO_NODE_SOCKET_PATH=node-bft1/ipc/node.sock ./cardano-cli query tip --cardano-mode --testnet-magic ${NETWORK_MAGIC} 2> /dev/null | jq -r .epoch)
1267
+ EPOCH_DELTA=\$ (( \$ EPOCH - \$ EPOCH_NOW ))
1268
+ if [ \$ EPOCH_DELTA -ge 2 ] ; then
1267
1269
echo ">>>> Ready!"
1268
1270
break
1269
1271
else
0 commit comments