-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy_test_ima.sh
executable file
·37 lines (29 loc) · 1.1 KB
/
deploy_test_ima.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
#!/usr/bin/env bash
#
# This script can be used to deploy specified version of skale-manager and IMA to the provided endpoint
# with given private key
#
set -ea
: "${ETH_PRIVATE_KEY?Need to set ETH_PRIVATE_KEY}"
: "${MANAGER_TAG?Need to set MANAGER_TAG}"
: "${IMA_TAG?Need to set IMA_TAG}"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
NETWORK=${NETWORK:-custom}
GAS_PRICE=${GAS_PRICE:-10000000000}
ETHERSCAN=${ETHERSCAN:-1234}
source $DIR/helper.sh
if [[ $CUSTOM_NETWORK ]]; then
create_test_docker_network
DOCKER_NETWORK_ENDPOINT=http://ganache:8545
DOCKER_NETWORK=testnet
else
DOCKER_NETWORK_ENDPOINT=http://127.0.0.1:8545
DOCKER_NETWORK=host
fi
if [[ $GANACHE ]]; then
run_ganache $ETH_PRIVATE_KEY
fi
deploy_manager $MANAGER_TAG $DOCKER_NETWORK_ENDPOINT $ETH_PRIVATE_KEY $GAS_PRICE $NETWORK $ETHERSCAN
echo "Copying $DIR/contracts_data/manager.json -> $DIR/contracts_data/skaleManagerComponents.json"
cp $DIR/contracts_data/manager.json $DIR/contracts_data/skaleManagerComponents.json
deploy_ima_proxy $IMA_TAG $DOCKER_NETWORK_ENDPOINT $ETH_PRIVATE_KEY $GAS_PRICE