Skip to content

Instantly share code, notes, and snippets.

@duccas
Last active January 9, 2021 18:03
Show Gist options
  • Save duccas/bf3f9bdcf8463d83c89e1f8b9b48c576 to your computer and use it in GitHub Desktop.
Save duccas/bf3f9bdcf8463d83c89e1f8b9b48c576 to your computer and use it in GitHub Desktop.
#!/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"b2c6657096aa30c5fafa5bd8ced48ea8dbd2b003@52.76.189.200:26656,ef472367307808b242a0d3f662d802431ed23063@175.41.186.255:26656,d3d2139a61c2a841545e78ff0e0cd03094a5197d@18.136.230.70: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