-
Notifications
You must be signed in to change notification settings - Fork 129
/
deploy_core.sh
executable file
·42 lines (33 loc) · 1.09 KB
/
deploy_core.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
#!/bin/bash
set -e
if [ -z "${NEAR_ENV}" ]; then
echo "NEAR_ENV is required, e.g. \`export NEAR_ENV=testnet\`"
exit 1
fi
if [ -z "${MASTER_ACCOUNT_ID}" ]; then
echo "MASTER_ACCOUNT_ID is required, e.g. \`export MASTER_ACCOUNT_ID=near\`"
exit 1
fi
if [ -z "${FOUNDATION_ACCOUNT_ID}"]; then
echo "FOUNDATION_ACCOUNT_ID is required, e.g. \`export FOUNDATION_ACCOUNT_ID=foundation.near\`"
fi
echo "Using NEAR_ENV=${NEAR_ENV}"
echo "Using MASTER_ACCOUNT_ID=${MASTER_ACCOUNT_ID}"
echo "Using FOUNDATION_ACCOUNT_ID=${FOUNDATION_ACCOUNT_ID}"
# Verifying master account exist
AMOUNT=$(near state $MASTER_ACCOUNT_ID | grep "amount")
if [ -z "$AMOUNT" ]; then
echo "Can't get state for master account ${MASTER_ACCOUNT_ID}. Maybe the account doesn't exist."
exit 1
fi
# Verifying foundation account exist
AMOUNT=$(near state $FOUNDATION_ACCOUNT_ID | grep "amount")
if [ -z "$AMOUNT" ]; then
echo "Can't get state for foundation account ${FOUNDATION_ACCOUNT_ID}. Maybe the account doesn't exist."
exit 1
fi
pushd deploy
./deploy_voting.sh
./deploy_whitelist.sh
./deploy_staking_pool_factory.sh
popd