-
Notifications
You must be signed in to change notification settings - Fork 0
/
wasmdstart.sh
executable file
·34 lines (25 loc) · 1.5 KB
/
wasmdstart.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
# default home is ~/.wasmd
# if you want to setup multiple apps on your local make sure to change this value
APP_HOME="./wasmddata"
RPC="tcp://0.0.0.0:26657"
CHAIN_ID="dorchain"
rm -rf $APP_HOME
# initialize wasmd configuration files
wasmd init dorchain --chain-id ${CHAIN_ID} --home ${APP_HOME}
# add minimum gas prices config to app configuration file
sed -i -r 's/minimum-gas-prices = ""/minimum-gas-prices = "0.0udor"/' ${APP_HOME}/config/app.toml
# enable 1317 API
perl -0777 -i.original -pe 's/# Enable defines if the API server should be enabled.\nenable = false/# Enable defines if the API server should be enabled.\nenable = true/igs' ${APP_HOME}/config/app.toml
# resolve CORS policy blocking during request to the chain by the Keplr API
sed -i -r 's/cors_allowed_origins = \[\]/cors_allowed_origins = \["*"\]/' ${APP_HOME}/config/config.toml
# add your wallet addresses to genesis
wasmd add-genesis-account $(wasmd keys show -a main --keyring-backend=test) 10000000000udor,10000000000stake --home ${APP_HOME}
wasmd add-genesis-account $(wasmd keys show -a validator --keyring-backend=test) 10000000000udor,10000000000stake --home ${APP_HOME}
# add fred's address as validator's address
wasmd gentx validator 1000000000stake --home ${APP_HOME} --chain-id ${CHAIN_ID} --keyring-backend=test --keyring-dir=~/.wasmd
# collect gentxs to genesis
wasmd collect-gentxs --home ${APP_HOME}
# validate the genesis file
wasmd validate-genesis --home ${APP_HOME}
# run the node
wasmd start --home ${APP_HOME} --rpc.laddr ${RPC}