forked from liquidity-network/nocust-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_contract.sh
executable file
·32 lines (27 loc) · 991 Bytes
/
deploy_contract.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
set -e
read -p "Ethereum RPC URL: " rpc_url
read -p "Owner's Address: " owner_addr
read -sp "Owner's Private Key (hidden): " private_key
if [ "$rpc_url" == "" ]; then
echo 1>&2 "Ethereum RPC URL is missing"
exit 3
fi
if [ "$owner_addr" == "" ]; then
echo 1>&2 "Owner's wallet address is missing"
exit 3
fi
if [ "$private_key" == "" ]; then
echo 1>&2 "Owner's wallet private key is missing"
exit 3
fi
cp just-deploy/requirements.txt ./requirements.txt
cp just-deploy/deploy.py ./deploy.py
cp just-deploy/deploy_linked.py ./deploy_linked.py
cp just-deploy/contracts/ethereum-hub-contract-10.json ./contract.json
sed -i "s/0x8e0381EE8312C692921daA789a9c9EE0C480a946/$owner_addr/g" ./contract.json
docker build -t just-deploy -f just-deploy/Dockerfile-deploy .
rm ./contract.json
rm ./deploy.py
rm ./requirements.txt
rm ./deploy_linked.py
docker run -it just-deploy python /code/deploy_linked.py /code/contract.json $private_key $rpc_url --publish