[#238]: Remove interactive password input from setup scripts

Signed-off-by: anastasia prasolova <anastasia@nspcc.ru>
This commit is contained in:
anastasia prasolova 2022-11-14 15:15:00 +03:00 committed by Anastasia Prasolova
parent 79a11641ed
commit d8e825443e
6 changed files with 34 additions and 28 deletions

View file

@ -1,19 +1,20 @@
#!/usr/bin/env bash
echo "Running bin/config.sh"
# Source env settings
. .env
. services/ir/.ir.env
source bin/helper.sh
# NeoGo binary path.
NEOGO="${NEOGO:-docker exec -it main_chain neo-go}"
NEOGO="${NEOGO:-docker exec main_chain neo-go}"
# Wallet files to change config value
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)
CONFIG_IMG="${CONFIG_IMG:-/wallets/config.yml}"
NETMAP_ADDR=$(bin/resolve.sh netmap.neofs) || die "Failed to resolve 'netmap.neofs' domain name"
# NeoFS configuration record: variable type [string|int|etc],
# key is a string and value is a constant of given type
@ -36,9 +37,9 @@ fi
echo "Changing ${KEY} configration value to ${VALUE}"
# shellcheck disable=SC2086
./bin/passwd.exp ${PASSWD} ${NEOGO} contract invokefunction \
-w ${WALLET_IMG} \
-a ${ADDR} \
${NEOGO} contract invokefunction \
--wallet-config ${CONFIG_IMG} \
-a ${ADDR} --force \
-r http://morph-chain.${LOCAL_DOMAIN}:30333 \
${NETMAP_ADDR} \
setConfig bytes:beefcafe \