#!/bin/bash exists() { command -v "$1" >/dev/null 2>&1 } if exists curl; then echo '' else sudo apt update && sudo apt install curl -y < "/dev/null" fi bash_profile=$HOME/.bash_profile if [ -f "$bash_profile" ]; then . $HOME/.bash_profile fi sleep 1 && curl -s https://api.nodes.guru/logo.sh | bash && sleep 1 if [ ! $KUJIRAD_NODENAME ]; then read -p "Enter node name: " KUJIRAD_NODENAME echo 'export KUJIRAD_NODENAME='\"${KUJIRAD_NODENAME}\" >> $HOME/.bash_profile fi echo 'source $HOME/.bashrc' >> $HOME/.bash_profile . $HOME/.bash_profile sleep 1 cd $HOME sudo apt update sudo apt install make clang pkg-config libssl-dev build-essential git jq ncdu bsdmainutils htop -y < "/dev/null" echo -e '\n\e[42mInstall Go\e[0m\n' && sleep 1 cd $HOME wget -O go1.18.1.linux-amd64.tar.gz https://golang.org/dl/go1.18.1.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.1.linux-amd64.tar.gz && rm go1.18.1.linux-amd64.tar.gz echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile echo 'export GO111MODULE=on' >> $HOME/.bash_profile echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && . $HOME/.bash_profile go version echo -e '\n\e[42mInstall software\e[0m\n' && sleep 1 rm -rf $HOME/kujira-core $HOME/.kujira/ git clone https://github.com/Team-Kujira/core $HOME/kujira-core cd $HOME/kujira-core git checkout v0.4.0 make install sleep 1 #ln -s $HOME/go/bin/kujirad /usr/local/bin/kujirad kujirad init "$KUJIRAD_NODENAME" --chain-id=harpoon-4 peers="87ea1a43e7eecdd54399551b767599921e170399@52.215.221.93:26656,021b782ba721e799cd3d5a940fc4bdad4264b148@65.108.103.236:16656,c40ad9c0446d7ecb4e991a45cbfb81a685617a55@104.248.165.123:26656,ccd2861990a98dc6b3787451485b2213dd3805fa@185.144.99.234:26656,909b8da1ea042a75e0e5c10dc55f37711d640388@95.216.208.150:53756,235d6ac8aebf5b6d1e6d46747958c6c6ff394e49@95.111.245.104:26656,b525548dd8bb95d93903b3635f5d119523b3045a@194.163.142.29:26656,26876aff0abd62e0ab14724b3984af6661a78293@139.59.38.171:36346,21fb5e54874ea84a9769ac61d29c4ff1d380f8ec@188.132.128.149:25656,06ebd0b308950d5b5a0e0d81096befe5ba07e0b3@193.31.118.143:25656,f9ee35cf9aec3010f26b02e5b3354efaf1c02d53@116.203.135.192:26656,c014d76c1a0d1e0d60c7a701a7eff5d639c6237c@157.90.179.182:29656,0ae4b755e3da85c7e3d35ce31c9338cb648bba61@164.92.187.133:26656,202a3d8bd5a0e151ced025fc9cbff606845c6435@49.12.222.155:26656,843e2db960439151cd6b87d7c3bd7aea5e2d552f@95.216.7.241:40000,5334c2ad190a10b1e16165491903a7ce37659cd8@65.108.150.72:26656,24c582547690a2c529bef10d04ffb1acd5c30556@[2a01:4f9:1a:a718::5]:26656,e843509f244087fcd86f47dbf09fdc3b8983a8be@82.65.223.126:46656,d26a03f681850e679af0fdcf646c5d4d3435e607@206.189.15.47:36346,d317a5e54e886f1c721423359732b061d213f783@162.55.27.100:26612,362468ed96561770cd32fc0f7cbd45d2e5985d38@146.19.24.243:26656,cf445792afd448d5e79946226a8d86b3a29515c0@46.101.2.221:26656,0be7dfe405e364f87bda949a6692c24b2fcb66af@37.143.129.221:26656,32cadeecf6fe6ae152187b06ed7e093d19bd663e@88.208.57.200:26656,1b1ac7b7e957e9e2d5391a38b1ba3e4e5d2f3210@135.181.146.40:26656,9243239f47e55050afcb408e15bc1eb946003686@66.94.111.40:26656,32cadeecf6fe6ae152187b06ed7e093d19bd663e@88.208.57.200:26656,2b03400fd39304b04d8801de1d321d2a05e2cf0d@[2607:5300:205:300::11a6]:26666,9470c4e3c95ee574116b60c9d97f181c8906e9b3@135.181.209.51:26876,65dd5ec89379a88a87e096d6daf1f50cde12655e@94.103.92.39:26656,fbcb66dad0de1d857cd14e579e31f8f1e5b43f53@161.97.152.78:26656,714d5eac33a3a22fd264e8603f200c20d6bac34d@185.106.94.59:26656,ca7d24539da9f2dbd84e7f2991608910d1843d2d@65.21.134.202:26616,9831c8c1d9e924944a35ee0110345c4e5a69597d@65.21.131.215:26616,debe8f29511ba472314e597adc6ca79728b82659@135.181.129.86:10856,26c2c562d2e00247f462e5e9f170aecb415e9c28@54.36.109.62:26656,0bbe1fdcabb59e381fe0e461b04a1822fb1d656a@65.108.232.150:23095,4d70f900e7ab80bcdf76c2ceace5b6abc606b83d@37.143.129.221:26656,45520598b23d1eccc6d69a8975a77b32b1b9787a@65.108.228.227:26656,4bba4fc2d07b6f8b5aa0de8668e9d10cf22f1fe8@65.108.229.56:26656,030f65339defb01b0e3ddaeaa54cbeac00dd0c74@185.169.252.239:26656,f559d66add4e0821b1996b04f8e73a948d0757bd@161.97.74.88:46656,3f26aa959f2a0f16749747c63767c1e491275cae@88.198.242.163:26656,c4ddd1c13e5bde82768eebd567b58364d872c9a5@62.171.144.51:26656,d41e073286a0e7d6a647412c15e70457bbf306b3@161.97.109.47:26651,aa3643753c57f85148906a2f44fb85d3d583fe9a@49.12.224.69:26656,b47468f355cfa45dfaacfb4a2e1ab89b3a53d0b7@116.203.233.112:26656,20f0409359fa455d7ca11b81039782a260899579@195.201.164.223:26656" #sed -i "s/^seeds *=.*/seeds = \"$seeds\"/;" $HOME/.kujira/config/config.toml sed -i.bak "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/;" $HOME/.kujira/config/config.toml #### VALIDATOR #### sed -i "s/pruning *=.*/pruning = \"custom\"/g" $HOME/.kujira/config/app.toml sed -i "s/pruning-keep-recent *=.*/pruning-keep-recent = \"809\"/g" $HOME/.kujira/config/app.toml sed -i "s/pruning-interval *=.*/pruning-interval = \"43\"/g" $HOME/.kujira/config/app.toml sed -i.bak -e "s/indexer *=.*/indexer = \"null\"/g" $HOME/.kujira/config/config.toml sed -i "s/index-events =.*/index-events = [\"tx.hash\",\"tx.height\"]/g" $HOME/.kujira/config/app.toml sed -i.bak "s/minimum-gas-prices =.*/minimum-gas-prices = \"0.00125ukuji\"/" $HOME/.kujira/config/app.toml sed -i "s/^timeout_commit =.*/timeout_commit = \"1500ms\"/" $HOME/.kujira/config/config.toml wget -O $HOME/.kujira/config/genesis.json https://raw.githubusercontent.com/Team-Kujira/networks/master/testnet/harpoon-4.json kujirad tendermint unsafe-reset-all #wget -O $HOME/.kujira/config/addrbook.json https://raw.githubusercontent.com/Team-Kujira/networks/master/testnet/addrbook.json echo -e '\n\e[42mRunning\e[0m\n' && sleep 1 echo -e '\n\e[42mCreating a service\e[0m\n' && sleep 1 echo "[Unit] Description=Kujirad Node After=network.target [Service] User=$USER Type=simple ExecStart=$(which kujirad) start Restart=on-failure LimitNOFILE=65535 [Install] WantedBy=multi-user.target" > $HOME/kujirad.service sudo mv $HOME/kujirad.service /etc/systemd/system sudo tee </dev/null /etc/systemd/journald.conf Storage=persistent EOF echo -e '\n\e[42mRunning a service\e[0m\n' && sleep 1 sudo systemctl restart systemd-journald sudo systemctl daemon-reload sudo systemctl enable kujirad sudo systemctl restart kujirad echo -e '\n\e[42mCheck node status\e[0m\n' && sleep 1 if [[ `service kujirad status | grep active` =~ "running" ]]; then echo -e "Your kujira node \e[32minstalled and works\e[39m!" echo -e "You can check node status by the command \e[7mservice kujirad status\e[0m" echo -e "Press \e[7mQ\e[0m for exit from status menu" else echo -e "Your kujirad node \e[31mwas not installed correctly\e[39m, please reinstall." fi