From 70b55aab4f2cc5579a45f05168f6c3954532646e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 23 Oct 2020 12:49:33 +0300 Subject: [PATCH] Add script to make NeoFS deposit Signed-off-by: Stanislav Bogatyrev --- bin/deposit.sh | 26 ++++++++++++++++++++++++++ services/chain/docker-compose.yml | 1 + 2 files changed, 27 insertions(+) create mode 100755 bin/deposit.sh diff --git a/bin/deposit.sh b/bin/deposit.sh new file mode 100755 index 0000000..41b7369 --- /dev/null +++ b/bin/deposit.sh @@ -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} diff --git a/services/chain/docker-compose.yml b/services/chain/docker-compose.yml index eaf7a65..0a357c8 100644 --- a/services/chain/docker-compose.yml +++ b/services/chain/docker-compose.yml @@ -19,6 +19,7 @@ services: - ./protocol.privnet.yml:/config/protocol.privnet.yml - ./node-wallet.json:/wallets/node-wallet.json - ./../../vendor/hosts:/etc/hosts + - ./../../wallets/wallet.json:/wallets/wallet.json networks: chain_int: