2021-02-12 11:53:17 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-10-23 09:49:33 +00:00
|
|
|
|
2021-02-26 15:06:36 +00:00
|
|
|
# Source env settings
|
2020-10-23 09:49:33 +00:00
|
|
|
. .env
|
|
|
|
. services/ir/.ir.env
|
|
|
|
|
|
|
|
# NeoGo binary path.
|
|
|
|
NEOGO="${NEOGO:-docker exec -it main_chain neo-go}"
|
|
|
|
# Wallet file to use for deposit GAS from
|
|
|
|
WALLET="${WALLET:-wallets/wallet.json}"
|
2021-06-01 18:18:46 +00:00
|
|
|
# Wallet password that would be entered automatically; '-' means no password
|
|
|
|
PASSWD="-"
|
2020-10-23 09:49:33 +00:00
|
|
|
# How much GAS to deposit. First cli argument or 50 by default
|
|
|
|
DEPOSIT="${1:-50}"
|
|
|
|
|
|
|
|
# Internal variables
|
|
|
|
ADDR=`cat ${WALLET} | jq -r .accounts[0].address`
|
2021-05-17 08:13:03 +00:00
|
|
|
CONTRACT_ADDR=`${NEOGO} util convert ${NEOFS_IR_CONTRACTS_NEOFS} | grep 'LE ScriptHash to Address' | awk '{print $5}' | grep -oP [A-z0-9]+`
|
2020-10-23 09:49:33 +00:00
|
|
|
|
|
|
|
# Make deposit
|
2021-06-01 18:18:46 +00:00
|
|
|
./bin/passwd.exp ${PASSWD} ${NEOGO} wallet nep17 transfer \
|
2020-10-23 09:49:33 +00:00
|
|
|
-w ${WALLET} \
|
|
|
|
-r http://main_chain.${LOCAL_DOMAIN}:30333 \
|
2021-05-17 08:13:03 +00:00
|
|
|
--from ${ADDR} \
|
|
|
|
--to ${CONTRACT_ADDR} \
|
|
|
|
--token GAS \
|
|
|
|
--amount ${DEPOSIT}
|