add sleep for one morph block time on tick new epoch

Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
This commit is contained in:
anastasia prasolova 2021-08-25 15:20:40 +03:00 committed by Alex Vanin
parent 5067095ec0
commit 5f98261112

View file

@ -24,6 +24,10 @@ else
ADDR=`cat ${WALLET} | jq -r .accounts[0].address` ADDR=`cat ${WALLET} | jq -r .accounts[0].address`
fi 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 # Fetch current epoch value
EPOCH=`${NEOGO_NONINTERACTIVE} contract testinvokefunction -r \ EPOCH=`${NEOGO_NONINTERACTIVE} contract testinvokefunction -r \
http://morph_chain.${LOCAL_DOMAIN}:30333 \ http://morph_chain.${LOCAL_DOMAIN}:30333 \
@ -37,3 +41,6 @@ echo "Updating NeoFS epoch to $((EPOCH+1))"
-r http://morph_chain.${LOCAL_DOMAIN}:30333 \ -r http://morph_chain.${LOCAL_DOMAIN}:30333 \
${NEOFS_IR_CONTRACTS_NETMAP} \ ${NEOFS_IR_CONTRACTS_NETMAP} \
newEpoch int:$((EPOCH+1)) -- ${ADDR}:Global newEpoch int:$((EPOCH+1)) -- ${ADDR}:Global
# Wait one Morph block to ensure the transaction broadcasted
sleep $BLOCK_DURATION