Last active
September 30, 2020 12:45
-
-
Save anilcse/44267e2c5f8c7dd65d8280b8ae067cfb to your computer and use it in GitHub Desktop.
devnet-37.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "this requires go 1.13+" | |
YOUR_KEY_NAME=mykey | |
YOUR_NAME=myname | |
DAEMON=gaiad | |
PERSISTENT_PEERS="20daee1a8d19c070ed27ab5fb291335611f02ad3@157.245.65.98:26656" | |
echo "install gaia v2.0.13, Cosmos-SDK@0.37.14" | |
git clone https://github.com/cosmos/gaia $GOPATH/src/github.com/cosmos/gaia | |
cd $GOPATH/src/github.com/cosmos/gaia | |
git checkout v2.0.13 | |
make install | |
echo "Creating keys" | |
gaiacli keys add $YOUR_KEY_NAME | |
echo "Setting up your validator" | |
gaiad init --chain-id devnet-37 $YOUR_NAME | |
curl http://157.245.65.98:26657/genesis | jq .result.genesis > ~/.gaiad/config/genesis.json | |
echo "----------Setting config for seed node---------" | |
sed -i 's#tcp://127.0.0.1:26657#tcp://0.0.0.0:26657#g' ~/.gaiad/config/config.toml | |
sed -i '/persistent_peers =/c\persistent_peers = "'"$PERSISTENT_PEERS"'"' ~/.gaiad/config/config.toml | |
DAEMON_PATH=$(which $DAEMON) | |
echo "---------Creating system file---------" | |
echo "[Unit] | |
Description=${DAEMON} daemon | |
After=network-online.target | |
[Service] | |
User=${USER} | |
ExecStart=${DAEMON_PATH} start --pruning nothing | |
Restart=always | |
RestartSec=3 | |
LimitNOFILE=4096 | |
[Install] | |
WantedBy=multi-user.target | |
" >$DAEMON.service | |
sudo mv $DAEMON.service /lib/systemd/system/$DAEMON.service | |
sudo -S systemctl daemon-reload | |
sudo -S systemctl start $DAEMON | |
echo "Your node setup is done. You would need some tokens to start your validator." | |
echo | |
echo "Your account address is :" | |
gaiacli keys show $YOUR_KEY_NAME -a | |
echo | |
echo | |
echo "After receiving tokens, you can create your validator by running" | |
echo 'gaiacli tx staking create-validator --amount 1000000000stake --commission-max-change-rate "0.1" --commission-max-rate "0.20" --commission-rate "0.1" --details "Some details about yourvalidator" --from $YOUR_KEY_NAME --pubkey=$(gaiad tendermint show-validator) --moniker $YOUR_NAME --min-self-delegation "1" --chain-id devnet-37' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment