From 5f9826111201c30fc7c2c0e949580b1bcd72a8af Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Wed, 25 Aug 2021 15:20:40 +0300 Subject: [PATCH] add sleep for one morph block time on tick new epoch Signed-off-by: anastasia prasolova --- bin/tick.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/tick.sh b/bin/tick.sh index 1f5620e..9b28be4 100755 --- a/bin/tick.sh +++ b/bin/tick.sh @@ -24,6 +24,10 @@ else ADDR=`cat ${WALLET} | jq -r .accounts[0].address` fi +# Grep Morph block time +SIDECHAIN_PROTO="${SIDECHAIN_PROTO:-services/morph_chain/protocol.privnet.yml}" +BLOCK_DURATION=`grep SecondsPerBlock < $SIDECHAIN_PROTO | awk '{print $2}'` + # Fetch current epoch value EPOCH=`${NEOGO_NONINTERACTIVE} contract testinvokefunction -r \ http://morph_chain.${LOCAL_DOMAIN}:30333 \ @@ -37,3 +41,6 @@ echo "Updating NeoFS epoch to $((EPOCH+1))" -r http://morph_chain.${LOCAL_DOMAIN}:30333 \ ${NEOFS_IR_CONTRACTS_NETMAP} \ newEpoch int:$((EPOCH+1)) -- ${ADDR}:Global + +# Wait one Morph block to ensure the transaction broadcasted +sleep $BLOCK_DURATION