From 4b72092ced2d6364293d23ebb3324a4603c32144 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 21 Sep 2021 17:59:35 +0300 Subject: [PATCH] [#47] Use NNS resolver in scripts Signed-off-by: Alex Vanin --- bin/config.sh | 3 ++- bin/tick.sh | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/config.sh b/bin/config.sh index 50d4b36..d9ee540 100755 --- a/bin/config.sh +++ b/bin/config.sh @@ -12,6 +12,7 @@ WALLET="${WALLET:-services/chain/node-wallet.json}" WALLET_IMG="${WALLET_IMG:-wallets/node-wallet.json}" # Wallet password that would be entered automatically; '-' means no password PASSWD="one" +NETMAP_ADDR=`bin/resolve.sh netmap.neofs` # NeoFS configuration record: key is a string and value is an int KEY=${1} @@ -33,7 +34,7 @@ echo "Changing ${KEY} configration value to ${VALUE}" -w ${WALLET_IMG} \ -a ${ADDR} \ -r http://morph_chain.${LOCAL_DOMAIN}:30333 \ -${NEOFS_IR_CONTRACTS_NETMAP} \ +${NETMAP_ADDR} \ setConfig bytes:beefcafe \ string:${KEY} \ int:${VALUE} -- ${ADDR} || exit 1 diff --git a/bin/tick.sh b/bin/tick.sh index 9b28be4..2b71070 100755 --- a/bin/tick.sh +++ b/bin/tick.sh @@ -27,11 +27,12 @@ fi # Grep Morph block time SIDECHAIN_PROTO="${SIDECHAIN_PROTO:-services/morph_chain/protocol.privnet.yml}" BLOCK_DURATION=`grep SecondsPerBlock < $SIDECHAIN_PROTO | awk '{print $2}'` +NETMAP_ADDR=`bin/resolve.sh netmap.neofs` # Fetch current epoch value EPOCH=`${NEOGO_NONINTERACTIVE} contract testinvokefunction -r \ http://morph_chain.${LOCAL_DOMAIN}:30333 \ -${NEOFS_IR_CONTRACTS_NETMAP} \ +${NETMAP_ADDR} \ epoch | grep 'value' | awk -F'"' '{ print $4 }'` echo "Updating NeoFS epoch to $((EPOCH+1))" @@ -39,7 +40,7 @@ echo "Updating NeoFS epoch to $((EPOCH+1))" -w ${WALLET_IMG} \ -a ${ADDR} \ -r http://morph_chain.${LOCAL_DOMAIN}:30333 \ -${NEOFS_IR_CONTRACTS_NETMAP} \ +${NETMAP_ADDR} \ newEpoch int:$((EPOCH+1)) -- ${ADDR}:Global # Wait one Morph block to ensure the transaction broadcasted