-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
Β·41 lines (30 loc) Β· 1.69 KB
/
entrypoint.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
#!/bin/sh
set -eux -o pipefail
if [ -f ~/.minitia/config/bootstrapped ]; then
exec "$@"
fi
rm -rf ~/.minitia 2>/dev/null || true
envsubst < config.template.json > config.json
minitiad launch --with-config config.json
dasel put -f ~/.minitia/config/client.toml -t string 'chain-id' -v $MINITIA_CHAIN_ID
dasel put -f ~/.minitia/config/client.toml -t string 'keyring-backend' -v 'test'
dasel put -f ~/.minitia/config/client.toml -t string 'output' -v 'json'
minitiad start &
sleep 5
function wait_tx() {
while ! minitiad q tx $1 >/dev/null 2>&1; do
sleep 0.1
done
}
export MINITIAD_GAS="auto"
export MINITIAD_YES="1"
# Grant permissions to operator accounts
wait_tx $(minitiad tx authz grant $OPERATOR1_EXECUTOR generic --msg-type "/opinit.opchild.v1.MsgFinalizeTokenDeposit" --from $MINITIA_BRIDGE_EXECUTOR | jq -r '.txhash')
wait_tx $(minitiad tx authz grant $OPERATOR2_EXECUTOR generic --msg-type "/opinit.opchild.v1.MsgFinalizeTokenDeposit" --from $MINITIA_BRIDGE_EXECUTOR | jq -r '.txhash')
wait_tx $(minitiad tx authz grant $OPERATOR3_EXECUTOR generic --msg-type "/opinit.opchild.v1.MsgFinalizeTokenDeposit" --from $MINITIA_BRIDGE_EXECUTOR | jq -r '.txhash')
wait_tx $(minitiad tx authz grant $OPERATOR1_EXECUTOR generic --msg-type "/opinit.opchild.v1.MsgUpdateOracle" --from $MINITIA_BRIDGE_EXECUTOR | jq -r '.txhash')
wait_tx $(minitiad tx authz grant $OPERATOR2_EXECUTOR generic --msg-type "/opinit.opchild.v1.MsgUpdateOracle" --from $MINITIA_BRIDGE_EXECUTOR | jq -r '.txhash')
wait_tx $(minitiad tx authz grant $OPERATOR3_EXECUTOR generic --msg-type "/opinit.opchild.v1.MsgUpdateOracle" --from $MINITIA_BRIDGE_EXECUTOR | jq -r '.txhash')
kill %1; wait %1
touch ~/.minitia/config/bootstrapped
exec "$@"