-
Notifications
You must be signed in to change notification settings - Fork 11
/
env.sh
227 lines (215 loc) · 12 KB
/
env.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#!/bin/bash
### IMPORTANT NOTICE
### It is not recommended to modify this file directly. Instead you can create a file named `override-env.sh` and write modified values there
# Pre-requisites
command -v jq > /dev/null 2>&1 || { echo >&2 "ERR: jq not installed. More info: https://stedolan.github.io/jq/download/ (Hint: sudo apt install jq -y)"; exit 1; }
command -v yq > /dev/null 2>&1 || { echo >&2 "ERR: yq not installed. More info: https://github.com/kislyuk/yq/ (Hint: sudo apt install python3-pip -y && pip3 install yq)"; exit 1; }
command -v tomlq > /dev/null 2>&1 || { echo >&2 "ERR: tomlq not installed, it is expected to be delivered within yq package"; exit 1; }
command -v bc > /dev/null 2>&1 || { echo >&2 "ERR: bc command could not be found"; exit 1; }
command -v make > /dev/null 2>&1 || { echo >&2 "ERR: make command could not be found"; exit 1; }
command -v go > /dev/null 2>&1 || { echo >&2 "ERR: go was not installed. More info: https://go.dev/doc/install"; exit 1; }
# Configurations
## Keyring
### Must be lowercase
export KEYRING="test" # Valid values are 'file' or 'test', must be 'file' for cloud or production env (DANGER: keyring test will allow transfer token from validator without key)
##
export NOTICE_DEV_ENV="This sample scripts was developed on an Ubuntu 22.04 LTS machine"
## Network
export MONIKER='moniker'
export NUMBER_OF_VALIDATOR=5 # Maximum number of active validators. If number of validators more than this, only the first X validators will be choosen (order by power)
export MINIMUM_GOV_DEPOSIT=64 # Minimum amount of coins required to submit a proposal
export VOTING_PERIOID_IN_MINUTES=2880 # 2880 minutes = 2 days
### Chain 1
export CHAIN_1_TYPE="evmos" # valid values are 'evmos' or 'cosmos' only, must be 'evmos' for evmos chain, otherwise 'cosmos' for other chains
export CHAIN_1_ID="evmos_9000-5"
export CHAIN_1_COINTYPE=60 # 60 for EVMOS, 118 for Cosmos
export CHAIN_1_ACCOUNT_PREFIX="evmos"
export CHAIN_1_GIT_REPO="https://github.com/evmos/evmos.git"
export CHAIN_1_GIT_REPO_BRANCH="v12.1.6" # must belong to repo $CHAIN_1_GIT_REPO
export CHAIN_1_DAEMON_BINARY_NAME="evmosd"
export CHAIN_1_DENOM_SYMBOL="evmos"
export CHAIN_1_MIN_DENOM_SYMBOL="aevmos"
export CHAIN_1_GAS_DENOM_SYMBOL="nevmos"
export CHAIN_1_DENOM_EXPONENT=18 # no of digits (18 for evmos, 6 for cosmos atom)
export CHAIN_1_GAS_DENOM_EXPONENT=9 # no of digits (9 for evmos, 3 for cosmos atom)
export CHAIN_1_EXPOSE_RPC_TO_PORT=26657
export CHAIN_1_EXPOSE_GRPC_TO_PORT=9090
export CHAIN_1_EXPOSE_JSON_RPC_TO_PORT=8545
export CHAIN_1_EXPOSE_WEBSOCKET_JSON_RPC_TO_PORT=8546
export CHAIN_1_EXPOSE_REST_API_TO_PORT=1317
export CHAIN_1_EXPOSE_P2P_TO_PORT=26656
### Chain 2
export CHAIN_2_TYPE="evmos" # valid values are 'evmos' or 'cosmos' only, must be 'evmos' for evmos chain, otherwise 'cosmos' for other chains
export CHAIN_2_ID="evmos_9000-6"
export CHAIN_2_COINTYPE=60 # 60 for EVMOS, 118 for Cosmos
export CHAIN_2_ACCOUNT_PREFIX="evmos"
export CHAIN_2_GIT_REPO="https://github.com/evmos/evmos.git"
export CHAIN_2_GIT_REPO_BRANCH="v12.1.6" # must belong to repo $CHAIN_2_GIT_REPO
export CHAIN_2_DAEMON_BINARY_NAME="evmosd"
export CHAIN_2_DENOM_SYMBOL="evmos"
export CHAIN_2_MIN_DENOM_SYMBOL="aevmos"
export CHAIN_2_GAS_DENOM_SYMBOL="nevmos"
export CHAIN_2_DENOM_EXPONENT=18 # no of digits (18 for evmos, 6 for cosmos atom)
export CHAIN_2_GAS_DENOM_EXPONENT=9 # no of digits (9 for evmos, 3 for cosmos atom)
export CHAIN_2_EXPOSE_RPC_TO_PORT=36657
export CHAIN_2_EXPOSE_GRPC_TO_PORT=19090
export CHAIN_2_EXPOSE_JSON_RPC_TO_PORT=18545
export CHAIN_2_EXPOSE_WEBSOCKET_JSON_RPC_TO_PORT=18546
export CHAIN_2_EXPOSE_REST_API_TO_PORT=11317
export CHAIN_2_EXPOSE_P2P_TO_PORT=36656
#### (EVMOS specific)
### Chain 1
export EVMOS_CHAIN_1_CLAIM_MODULE_ACCOUNT="evmos15cvq3ljql6utxseh0zau9m8ve2j8erz89m5wkz"
### Chain 2
export EVMOS_CHAIN_2_CLAIM_MODULE_ACCOUNT="evmos15cvq3ljql6utxseh0zau9m8ve2j8erz89m5wkz"
## Validators
export VAL_KEYRING_FILE_ENCRYPTION_PASSWORD="11111111"
export VAL_COMMISSION_RATE=0.05 # 5%
export VAL_COMMISSION_RATE_MAX=0.20 # 20%
export VAL_COMMISSION_CHANGE_RATE_MAX=0.01 # 1%
export VAL_MIN_SELF_DELEGATION=1000000
export VAL_GAS_LIMIT_CREATE_VALIDATOR=300000
### Validator 1
export VAL_1_KEY_NAME="val1"
export VAL_1_RAW_BALANCE=50000000 # Validator 1 init with this amount of coin in balance
export VAL_1_RAW_STAKE=7000 # Validator 1 will stake this amount
export VAL_1_RAW_CLAIM=1000 # Validator 1 can claim this amount, evmos only
#### Chain 1
export VAL_1_CHAIN_1_SEED="spoil senior door access upset floor decorate shield high punch senior tape pigeon base slogan height clever buffalo cat report poem weapon labor satoshi"
#### Chain 2
export VAL_1_CHAIN_2_SEED="spoil senior door access upset floor decorate shield high punch senior tape pigeon base slogan height clever buffalo cat report poem weapon labor satoshi"
### Validator 2
export VAL_2_KEY_NAME="val2"
export VAL_2_RAW_BALANCE=50000000 # Validator 2 init with this amount of coin in balance
export VAL_2_RAW_STAKE=3000 # Validator 2 will stake this amount
export VAL_2_RAW_CLAIM=1000 # Validator 2 can claim this amount, evmos only
#### Chain 1
export VAL_2_CHAIN_1_SEED="width produce brush hour horse retreat play flag fresh broken measure culture scare broken erupt pilot buzz embody depend topic behind rigid fan battle"
#### Chain 2
export VAL_2_CHAIN_2_SEED="width produce brush hour horse retreat play flag fresh broken measure culture scare broken erupt pilot buzz embody depend topic behind rigid fan battle"
### Validator 3
export VAL_3_KEY_NAME="val3"
export VAL_3_RAW_BALANCE=50000000 # Validator 3 init with this amount of coin in balance
export VAL_3_RAW_STAKE=3000 # Validator 3 will stake this amount
export VAL_3_RAW_CLAIM=1000 # Validator 3 can claim this amount, evmos only
#### Chain 1
export VAL_3_CHAIN_1_SEED="stage grid emotion thumb safe myth chair dizzy beyond casual select polar hover retire master neglect shift zero trigger section token replace truly father"
#### Chain 2
export VAL_3_CHAIN_2_SEED="stage grid emotion thumb safe myth chair dizzy beyond casual select polar hover retire master neglect shift zero trigger section token replace truly father"
## Hermes (IBC Relayer)
export HERMES_GIT_REPO="https://github.com/informalsystems/ibc-rs.git"
export HERMES_GIT_REPO_BRANCH="v1.5.0" # Must belong to repo $HERMES_GIT_REPO
export HERMES_BINARY="hermes"
export HERMES_SOURCE_DIR_PREFIX="source-code" # do NOT modify
export HERMES_HOME_DIR=".hermes"
export HERMES_RESERVED_FEE=100 # will be transfered to relayer's account and reserved for relay purpose
### Chain 1
export HERMES_CFG_CHAIN_1_ID="$CHAIN_1_ID"
export HERMES_CFG_CHAIN_1_RPC_ADDR="127.0.0.1:$CHAIN_1_EXPOSE_RPC_TO_PORT"
export HERMES_CFG_CHAIN_1_GRPC_ADDR="127.0.0.1:$CHAIN_1_EXPOSE_GRPC_TO_PORT"
export HERMES_CFG_CHAIN_1_ACCOUNT_PREFIX="$CHAIN_1_ACCOUNT_PREFIX"
export HERMES_CFG_CHAIN_1_KEY_NAME="evmoskey"
export HERMES_CFG_CHAIN_1_GAS_PRICE_DENOM_SYMBOL="$CHAIN_1_MIN_DENOM_SYMBOL"
export HERMES_CFG_CHAIN_1_DENOM_EXPONENT=$CHAIN_1_DENOM_EXPONENT # no of digits (18 for evmos, 6 for cosmos atom)
### Chain 2
export HERMES_CFG_CHAIN_2_ID="$CHAIN_2_ID"
export HERMES_CFG_CHAIN_2_RPC_ADDR="127.0.0.1:$CHAIN_2_EXPOSE_RPC_TO_PORT"
export HERMES_CFG_CHAIN_2_GRPC_ADDR="127.0.0.1:$CHAIN_2_EXPOSE_GRPC_TO_PORT"
export HERMES_CFG_CHAIN_2_ACCOUNT_PREFIX="$CHAIN_2_ACCOUNT_PREFIX"
export HERMES_CFG_CHAIN_2_KEY_NAME="evmoskey"
export HERMES_CFG_CHAIN_2_GAS_PRICE_DENOM_SYMBOL="$CHAIN_2_MIN_DENOM_SYMBOL"
export HERMES_CFG_CHAIN_2_DENOM_EXPONENT=$CHAIN_2_DENOM_EXPONENT # no of digits
## Relayer account
## Since relayer require an account on each chain with coins to sign and broadcast tx
## so you have to provide account and load them some coins (for example: $HERMES_RESERVED_FEE)
### Chain 1
export REL_1_SEED="raw course slim hockey salt crawl sick safe december during armed fragile"
export REL_1_ADDR="evmos1metw56lk3k4vhkh0vzxlr8p4mzpjvttmagvekp" # Wallet address of the above seed on EVMOS chain
### Chain 2
export REL_2_SEED="raw course slim hockey salt crawl sick safe december during armed fragile"
export REL_2_ADDR="evmos1metw56lk3k4vhkh0vzxlr8p4mzpjvttmagvekp" # Wallet address of the above seed on EVMOS chain
## Big Dipper (bdjuno)
export BD_BINARY_ORIGIN="$GOPATH/bin/bdjuno"
export BD_PG_DB="bdjuno"
export BD_PG_USER="bdjuno"
export BD_PG_PASS="6N4QtFYMt7h972uazrWTckmMvFZWIje"
export BD_HASURA_BINARY=/usr/local/bin/hasura
export BD_HASURA_SECRET="myadminsecretkey"
export BD_PG_HASURA_META_DB="hasurameta"
export BD_PG_HASURA_DB="hasura"
export BD_PG_HASURA_USER="hasura"
export BD_PG_HASURA_PASS="PX2RNvtZ4m7fntnbRrtySB4ROG5EKk4J"
export BD_CFG_PG_USR_PASS="6N4QtFYMt7h972uazrWTckmMvFZWIje" # Password of default user postgres
### Chain 1
export BD_CFG_CHAIN_1_GIT_REPO="https://github.com/forbole/bdjuno.git"
export BD_CFG_CHAIN_1_GIT_REPO_BRANCH="chains/evmos/mainnet" # must belong to repo $BD_CFG_CHAIN_1_GIT_REPO
export BD_CFG_CHAIN_1_PG_PORT=5432
export BD_CFG_CHAIN_1_ACCOUNT_PREFIX="$CHAIN_1_ACCOUNT_PREFIX"
export BD_CFG_CHAIN_1_RPC_ADDR="127.0.0.1:$CHAIN_1_EXPOSE_RPC_TO_PORT"
export BD_CFG_CHAIN_1_GRPC_ADDR="127.0.0.1:$CHAIN_1_EXPOSE_GRPC_TO_PORT"
export BD_CFG_CHAIN_1_ID="$CHAIN_1_ID"
export BD_CFG_CHAIN_1_HASURA_PORT=8080
export BD_CFG_CHAIN_1_HASURA_ACTIONBASE_PORT=3000
export BD_CFG_CHAIN_1_DENOM_SYMBOL="$CHAIN_1_DENOM_SYMBOL" # evmos/atom/...
export BD_CFG_CHAIN_1_MIN_DENOM_SYMBOL="$CHAIN_1_MIN_DENOM_SYMBOL" # aevmos/uatom/...
export BD_CFG_CHAIN_1_DENOM_EXPONENT=$CHAIN_1_DENOM_EXPONENT # no of digits (18 for evmos, 6 for cosmos atom)
### Chain 2
export BD_CFG_CHAIN_2_GIT_REPO="https://github.com/forbole/bdjuno.git"
export BD_CFG_CHAIN_2_GIT_REPO_BRANCH="chains/evmos/mainnet" # must belong to repo $BD_CFG_CHAIN_2_GIT_REPO
export BD_CFG_CHAIN_2_PG_PORT=15432
export BD_CFG_CHAIN_2_ACCOUNT_PREFIX="$CHAIN_2_ACCOUNT_PREFIX"
export BD_CFG_CHAIN_2_RPC_ADDR="127.0.0.1:$CHAIN_2_EXPOSE_RPC_TO_PORT"
export BD_CFG_CHAIN_2_GRPC_ADDR="127.0.0.1:$CHAIN_2_EXPOSE_GRPC_TO_PORT"
export BD_CFG_CHAIN_2_ID="$CHAIN_2_ID"
export BD_CFG_CHAIN_2_HASURA_PORT=8082
export BD_CFG_CHAIN_2_HASURA_ACTIONBASE_PORT=3002
export BD_CFG_CHAIN_2_DENOM_SYMBOL="$CHAIN_2_DENOM_SYMBOL" # evmos/atom/...
export BD_CFG_CHAIN_2_MIN_DENOM_SYMBOL="$CHAIN_2_MIN_DENOM_SYMBOL" # aevmos/uatom...
export BD_CFG_CHAIN_2_DENOM_EXPONENT=$CHAIN_2_DENOM_EXPONENT # no of digits (18 for evmos, 6 for cosmos atom)
### Big Dipper 2.0 for Cosmos based chains
### Chain 1
export BD2_CFG_CHAIN_1_GIT_REPO="https://github.com/forbole/big-dipper-2.0-cosmos.git"
export BD2_CFG_CHAIN_1_BRANCH="[email protected]"
export BD2_CFG_CHAIN_1_PROJECT_NAME="web-evmos" # project name under ./apps/
export BD2_CFG_CHAIN_1_CHAIN_NAME="evmos" # chain name to be set into ./apps/web-x/src/chain.json
export BD2_CFG_CHAIN_1_PORT=3800
export BD2_CFG_CHAIN_1_PUBLIC_DOMAIN="127.0.0.1"
export BD2_CFG_CHAIN_1_PUBLIC_RPC_26657="127.0.0.1:$CHAIN_1_EXPOSE_RPC_TO_PORT"
### Chain 2
export BD2_CFG_CHAIN_2_GIT_REPO="https://github.com/forbole/big-dipper-2.0-cosmos.git"
export BD2_CFG_CHAIN_2_BRANCH="[email protected]"
export BD2_CFG_CHAIN_2_PROJECT_NAME="web-evmos" # project name under ./apps/
export BD2_CFG_CHAIN_2_CHAIN_NAME="evmos" # chain name to be set into ./apps/web-x/src/chain.json
export BD2_CFG_CHAIN_2_PORT=3802
export BD2_CFG_CHAIN_2_PUBLIC_DOMAIN="127.0.0.1"
export BD2_CFG_CHAIN_2_PUBLIC_RPC_26657="127.0.0.1:$CHAIN_2_EXPOSE_RPC_TO_PORT"
## Reflects by above config (edit at your own risk)
export HERMES_SERVICE_NAME=$HERMES_BINARY'-svc'
### Docker
export DOCKER_IMAGE_NAME_PREFIX="evmos.victortrusty.dev:c"
# Others # Just skip this part, don't read, no more custom-able here
echo $NOTICE_DEV_ENV
if [ -z "$GOPATH" ]; then
echo >&2 "ERR: Missing GOPATH environment variable, should be '$HOME/go'"
exit 1
fi
command -v systemctl > /dev/null 2>&1
if [ $? -eq 0 ]; then
export DISABLE_SYSTEMCTL=0
elif [ ! -d "/etc/systemd/system" ]; then
export DISABLE_SYSTEMCTL=1
else
export DISABLE_SYSTEMCTL=1
fi
if [ "$FORCE_EXTRA_FUNC" = "1" ]; then
export EXTRA_FUNC=1
elif [ -f "./extra_func.lic" ]; then
export EXTRA_FUNC=1
elif [ -f "../extra_func.lic" ]; then
export EXTRA_FUNC=1
else
export EXTRA_FUNC=0
fi
if [ -f "../override-env.sh" ]; then
source "../override-env.sh"
fi