forked from babylonlabs-io/babylon-integration-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpost-deployment.sh
executable file
·83 lines (73 loc) · 3.71 KB
/
post-deployment.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
echo "Installing dependencies"
# Install jq in both containers
for container in babylondnode0 ibcsim-bcd; do
docker exec $container /bin/sh -c '
apt-get update && apt-get install -y jq
'
done
echo "Creating keyrings and sending funds to Babylon Node Consumers"
[[ "$(uname)" == "Linux" ]] && chown -R 1138:1138 .testnets/eotsmanager
sleep 15
echo "fund BTC staker account on Babylon"
docker exec babylondnode0 /bin/sh -c '
BTC_STAKER_ADDR=$(/bin/babylond --home /babylondhome/.tmpdir keys add \
btc-staker --output json --keyring-backend test | jq -r .address) && \
/bin/babylond --home /babylondhome tx bank send test-spending-key \
${BTC_STAKER_ADDR} 100000000ubbn --fees 2ubbn -y \
--chain-id chain-test --keyring-backend test
'
mkdir -p .testnets/btc-staker/keyring-test
mv .testnets/node0/babylond/.tmpdir/keyring-test/* .testnets/btc-staker/keyring-test
[[ "$(uname)" == "Linux" ]] && chown -R 1138:1138 .testnets/btc-staker
sleep 7
echo "fund finality provider account on Babylon"
docker exec babylondnode0 /bin/sh -c '
FP_BABYLON_ADDR=$(/bin/babylond --home /babylondhome/.tmpdir keys add \
finality-provider --output json --keyring-backend test | jq -r .address) && \
/bin/babylond --home /babylondhome tx bank send test-spending-key \
${FP_BABYLON_ADDR} 100000000ubbn --fees 2ubbn -y \
--chain-id chain-test --keyring-backend test
'
mkdir -p .testnets/finality-provider/keyring-test
cp -R .testnets/node0/babylond/.tmpdir/keyring-test/* .testnets/finality-provider/keyring-test
[[ "$(uname)" == "Linux" ]] && chown -R 1138:1138 .testnets/finality-provider
sleep 7
echo "fund finality provider account on Babylon consumer daemon"
docker exec ibcsim-bcd /bin/sh -c '
FP_CONSUMER_ADDR=$(bcd --home /data/bcd/.tmpdir keys add \
consumer-fp --output json --keyring-backend test | jq -r .address) && \
bcd --home /data/bcd/bcd-test tx bank send user \
${FP_CONSUMER_ADDR} 100000000ustake --fees 2ustake -y \
--chain-id bcd-test --keyring-backend test
'
mkdir -p .testnets/consumer-fp/keyring-test
cp -R .testnets/node0/babylond/.tmpdir/keyring-test/* .testnets/consumer-fp/keyring-test
cp -R .testnets/bcd/.tmpdir/keyring-test/* .testnets/consumer-fp/keyring-test
[[ "$(uname)" == "Linux" ]] && chown -R 1138:1138 .testnets/consumer-fp
sleep 7
echo "fund vigilante account on Babylon"
docker exec babylondnode0 /bin/sh -c '
VIGILANTE_ADDR=$(/bin/babylond --home /babylondhome/.tmpdir keys add \
vigilante --output json --keyring-backend test | jq -r .address) && \
/bin/babylond --home /babylondhome tx bank send test-spending-key \
${VIGILANTE_ADDR} 100000000ubbn --fees 2ubbn -y \
--chain-id chain-test --keyring-backend test
'
mkdir -p .testnets/vigilante/keyring-test .testnets/vigilante/bbnconfig
mv .testnets/node0/babylond/.tmpdir/keyring-test/* .testnets/vigilante/keyring-test
cp .testnets/node0/babylond/config/genesis.json .testnets/vigilante/bbnconfig
[[ "$(uname)" == "Linux" ]] && chown -R 1138:1138 .testnets/vigilante
sleep 7
echo "fund covenant committee account on Babylon"
mkdir -p .testnets/node0/babylond/.tmpdir/keyring-test
cp .testnets/covenant-emulator/keyring-test/* .testnets/node0/babylond/.tmpdir/keyring-test/
docker exec babylondnode0 /bin/sh -c '
COVENANT_ADDR=$(/bin/babylond --home /babylondhome/.tmpdir keys show covenant \
--output json --keyring-backend test | jq -r .address) && \
/bin/babylond --home /babylondhome tx bank send test-spending-key \
${COVENANT_ADDR} 100000000ubbn --fees 2ubbn -y \
--chain-id chain-test --keyring-backend test
'
[[ "$(uname)" == "Linux" ]] && chown -R 1138:1138 .testnets/covenant-emulator
echo "Created keyrings and sent funds"