Last active
January 9, 2021 18:03
-
-
Save duccas/bf3f9bdcf8463d83c89e1f8b9b48c576 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
curl -s https://gist.githubusercontent.com/icohigh/cb9eff63294a96bcb63a4590c1dc238c/raw/6461ab2af5819974b66257f48188d90caabe4a4b/components.sh | bash | |
sleep 2 | |
MONIKER=QStake | |
CHAIN=testnet-croeseid-2 | |
KEY=Ducca | |
LASTEST_HEIGHT=$(curl -s https://testnet-croeseid.crypto.com:26657/block | jq -r .result.block.header.height); \ | |
BLOCK_HEIGHT=$((LASTEST_HEIGHT - 1000)); \ | |
TRUST_HASH=$(curl -s "https://testnet-croeseid.crypto.com:26657/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) | |
curl -LOJ https://github.com/crypto-com/chain-main/releases/download/v0.8.0-rc1/chain-main_0.8.0-rc1_Linux_x86_64.tar.gz \ | |
&& tar -zxvf chain-main_0.8.0-rc1_Linux_x86_64.tar.gz \ | |
&& ./chain-maind init $MONIKER --chain-id $CHAIN \ | |
&& echo 'export NODE_ID=$(./chain-maind tendermint show-node-id)' >> $HOME/.bashrc \ | |
&& curl https://raw.githubusercontent.com/crypto-com/testnets/main/testnet-croeseid-2/genesis.json > ~/.chain-maind/config/genesis.json \ | |
&& sed -i.bak -E 's#^(minimum-gas-prices[[:space:]]+=[[:space:]]+)""$#\1"0.025basetcro"#' ~/.chain-maind/config/app.toml \ | |
&& sed -i.bak -E 's#^(persistent_peers[[:space:]]+=[[:space:]]+).*$#\1"[email protected]:26656,[email protected]:26656,[email protected]:26656"# ; s#^(create_empty_blocks_interval[[:space:]]+=[[:space:]]+).*$#\1"5s"#' ~/.chain-maind/config/config.toml \ | |
&& sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ | |
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"https://testnet-croeseid.crypto.com:26657,https://testnet-croeseid.crypto.com:26657\"| ; \ | |
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ | |
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ | |
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" ~/.chain-maind/config/config.toml \ | |
&& ./chain-maind tendermint show-validator \ | |
&& echo 'export VALIDATOR_ID=$(./chain-maind tendermint show-validator)' >> $HOME/.bashrc \ | |
&& echo 'export PATH=$PATH:$HOME/chain-main/' >> $HOME/.bashrc \ | |
&& echo 'export PATH=/root/chain-main:/root/:$PATH' >> $HOME/.bashrc \ | |
&& source ~/.bashrc \ | |
&& git clone https://github.com/crypto-com/chain-main.git && cd chain-main \ | |
&& ./networks/create-service.sh \ | |
&& sudo systemctl start chain-maind | |
sleep 3 | |
echo "" | |
echo "--------CRYPTO.COM INSTALLED--------" | |
echo "--------Check logs - journalctl -u chain-maind -f --------" | |
echo "--------Now you can create keys and run the Validator.--------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment