[#47] Use NNS resolver in scripts

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-09-21 17:59:35 +03:00 committed by Alex Vanin
parent 28f9083e9f
commit 4b72092ced
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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