Commit f450e937 authored by Son of Odin's avatar Son of Odin 💬

Merge branch 'feature/refund-testnet' into 'master'

Add cmd to refund testnet

See merge request !686
parents 4d2c28f0 5ef1cb76
Pipeline #128834186 passed with stages
in 68 minutes and 57 seconds
......@@ -45,3 +45,6 @@ clean-testnet-binance:
@rm -rf ${HOME}/.bnbcli
reset-testnet-binance: stop clean-testnet-binance run-testnet-binance
refund-testnet:
TAG=${TAG} NET=testnet docker-compose -p thornode -f ${path}../components/standalone.base.yml -f ${path}../components/standalone.${uname_S}.yml exec thor-api /docker/scripts/refund.sh localhost:1317
#!/bin/sh
# ./refund.sh localhost:1317
# set -ex
if [ -z $1 ]; then
echo "Missing thornode api address (address:port)"
exit 1
fi
# NOTE: the tx ID doesn't matter at all, just no blank as it would trigger ragnarok
TX_ID=91311A8951EEFC1C84B09338738BC0154E488778CBB3CF47143B3B96D18230C2
POOLS=$(curl -s $1/thorchain/pools)
USERNAME=thorchain
PASSWORD=password
refund_pool () {
asset=$(echo $1 | jq -r ".asset");
address=$(echo $1 | jq -r ".pool_address");
echo "Refunding pool $asset"
echo $PASSWORD | thorcli tx thorchain set-end-pool $asset $address $TX_ID --from $USERNAME --chain-id thorchain --home /root/.thorcli -y 2>&1
}
for pool in $(echo $POOLS | jq -c '.[]'); do
asset=$(echo $pool | jq -r ".asset");
if [ "$asset" = "BNB.BNB" ]; then
bnb=$pool
continue
fi
refund_pool $pool
done
refund_pool $bnb
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment