forked from ainblockchain/ain-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_node_gcp.sh
86 lines (79 loc) · 3.1 KB
/
start_node_gcp.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
84
85
86
#!/bin/sh
if [ "$#" -lt 2 ]; then
echo "Usage: sh start_node.sh spring 0 0"
exit
fi
if [ "$1" = 'spring' ]; then
export TRACKER_WS_ADDR=ws://35.221.137.80:5000 # spring-tracker-ip
elif [ "$1" = 'summer' ]; then
export TRACKER_WS_ADDR=ws://35.194.172.106:5000 # summer-tracker-ip
elif [ "$1" = 'staging' ]; then
export TRACKER_WS_ADDR=ws://35.221.150.73:5000 # staging-tracker-ip
elif [ "$1" = 'dev' ]; then
if [ "$2" = 0 ]; then
export TRACKER_WS_ADDR=ws://34.80.184.73:5000 # dev-tracker-ip
elif [ "$2" = 1 ]; then
export TRACKER_WS_ADDR=ws://35.187.153.22:5000 # dev-shard-1-tracker-ip
elif [ "$2" = 2 ]; then
export TRACKER_WS_ADDR=ws://34.80.203.104:5000 # dev-shard-2-tracker-ip
elif [ "$2" = 3 ]; then
export TRACKER_WS_ADDR=ws://35.189.174.17:5000 # dev-shard-3-tracker-ip
elif [ "$2" = 4 ]; then
export TRACKER_WS_ADDR=ws://35.221.164.158:5000 # dev-shard-4-tracker-ip
elif [ "$2" = 5 ]; then
export TRACKER_WS_ADDR=ws://35.234.46.65:5000 # dev-shard-5-tracker-ip
elif [ "$2" = 6 ]; then
export TRACKER_WS_ADDR=ws://35.221.210.171:5000 # dev-shard-6-tracker-ip
elif [ "$2" = 7 ]; then
export TRACKER_WS_ADDR=ws://34.80.222.121:5000 # dev-shard-7-tracker-ip
elif [ "$2" = 8 ]; then
export TRACKER_WS_ADDR=ws://35.221.200.95:5000 # dev-shard-8-tracker-ip
elif [ "$2" = 9 ]; then
export TRACKER_WS_ADDR=ws://34.80.216.199:5000 # dev-shard-9-tracker-ip
elif [ "$2" = 10 ]; then
export TRACKER_WS_ADDR=ws://34.80.161.85:5000 # dev-shard-10-tracker-ip
elif [ "$2" = 11 ]; then
export TRACKER_WS_ADDR=ws://35.194.239.169:5000 # dev-shard-11-tracker-ip
elif [ "$2" = 12 ]; then
export TRACKER_WS_ADDR=ws://35.185.156.22:5000 # dev-shard-12-tracker-ip
elif [ "$2" = 13 ]; then
export TRACKER_WS_ADDR=ws://35.229.247.143:5000 # dev-shard-13-tracker-ip
elif [ "$2" = 14 ]; then
export TRACKER_WS_ADDR=ws://35.229.226.47:5000 # dev-shard-14-tracker-ip
elif [ "$2" = 15 ]; then
export TRACKER_WS_ADDR=ws://35.234.61.23:5000 # dev-shard-15-tracker-ip
elif [ "$2" = 16 ]; then
export TRACKER_WS_ADDR=ws://34.80.66.41:5000 # dev-shard-16-tracker-ip
elif [ "$2" = 17 ]; then
export TRACKER_WS_ADDR=ws://35.229.143.18:5000 # dev-shard-17-tracker-ip
elif [ "$2" = 18 ]; then
export TRACKER_WS_ADDR=ws://35.234.58.137:5000 # dev-shard-18-tracker-ip
elif [ "$2" = 19 ]; then
export TRACKER_WS_ADDR=ws://34.80.249.104:5000 # dev-shard-19-tracker-ip
elif [ "$2" = 20 ]; then
export TRACKER_WS_ADDR=ws://35.201.248.92:5000 # dev-shard-20-tracker-ip
else
echo "Invalid shard ID argument: $2"
exit
fi
else
echo "Invalid season argument: $1"
exit
fi
echo "TRACKER_WS_ADDR=$TRACKER_WS_ADDR"
if [ "$3" -lt 0 ] || [ "$3" -gt 4 ]; then
echo "Invalid account_index argument: $2"
exit
fi
if [ "$2" = 0 ]; then
export NUM_VALIDATORS=5
else
export NUM_VALIDATORS=3
export GENESIS_CONFIGS_DIR="blockchain/shard_$2"
fi
export ACCOUNT_INDEX="$3"
echo "ACCOUNT_INDEX=$ACCOUNT_INDEX"
export HOSTING_ENV=gcp
export DEBUG=false
export LIGHTWEIGHT=true
nohup node client/index.js >/dev/null 2>&1 &