Add script to make NeoFS deposit

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-10-23 12:49:33 +03:00 committed by Stanislav Bogatyrev
parent e37c18b45f
commit 70b55aab4f
2 changed files with 27 additions and 0 deletions

26
bin/deposit.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
# Source env settigns
. .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}"
# 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`
LESH=`${NEOGO} util convert ${ADDR} | grep 'Address to LE ScriptHash' | awk '{print $5}' | grep -oP [A-z0-9]+`
# Make deposit
${NEOGO} contract invokefunction \
-w ${WALLET} \
-a ${ADDR} \
-r http://main_chain.${LOCAL_DOMAIN}:30333 \
${NEOFS_IR_CONTRACTS_NEOFS} \
deposit ${LESH} \
int:${DEPOSIT} \
bytes: -- ${LESH}

View file

@ -19,6 +19,7 @@ services:
- ./protocol.privnet.yml:/config/protocol.privnet.yml - ./protocol.privnet.yml:/config/protocol.privnet.yml
- ./node-wallet.json:/wallets/node-wallet.json - ./node-wallet.json:/wallets/node-wallet.json
- ./../../vendor/hosts:/etc/hosts - ./../../vendor/hosts:/etc/hosts
- ./../../wallets/wallet.json:/wallets/wallet.json
networks: networks:
chain_int: chain_int: