-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
99 lines (83 loc) · 4.51 KB
/
install.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
echo -e "\033[35m"
echo -e "https://t.me/ro_cryptoo"
echo -e "https://t.me/whitelistx1000"
echo -ne "\033[35m██████╗░░█████╗░ "
echo -e "\033[34m░█████╗░██████╗░██╗░░░██╗██████╗░████████╗░█████╗░"
echo -ne "\033[35m██╔══██╗██╔══██╗ "
echo -e "\033[34m██╔══██╗██╔══██╗╚██╗░██╔╝██╔══██╗╚══██╔══╝██╔══██╗"
echo -ne "\033[35m██████╔╝██║░░██║ "
echo -e "\033[34m██║░░╚═╝██████╔╝░╚████╔╝░██████╔╝░░░██║░░░██║░░██║"
echo -ne "\033[35m██╔══██╗██║░░██║ "
echo -e "\033[34m██║░░██╗██╔══██╗░░╚██╔╝░░██╔═══╝░░░░██║░░░██║░░██║"
echo -ne "\033[35m██║░░██║╚█████╔╝ "
echo -e "\033[34m╚█████╔╝██║░░██║░░░██║░░░██║░░░░░░░░██║░░░╚█████╔╝"
echo -ne "\033[35m╚═╝░░╚═╝░╚════╝░ "
echo -e "\033[34m░╚════╝░╚═╝░░╚═╝░░░╚═╝░░░╚═╝░░░░░░░░╚═╝░░░░╚════╝░"
echo -e "\033[35m"
sudo apt install --fix-broken -y &>/dev/null
sudo apt install nano mc wget -y &>/dev/null
if [ ! $EVMOS_NODENAME ]; then
read -p "Enter node name: " EVMOS_NODENAME
fi
sleep 1
echo 'export EVMOS_NODENAME='$EVMOS_NODENAME >> $HOME/.profile
echo "Installing dependencies"
curl -s https://raw.githubusercontent.com/Kallen-c/utils/main/installers/install_ufw.sh | bash &>/dev/null
curl -s https://raw.githubusercontent.com/Kallen-c/utils/main/installers/install_go.sh | bash &>/dev/null
source .profile
source .bashrc
sleep 1
echo "Depedencies installed"
if [ ! -d $HOME/evmos/ ]; then
git clone https://github.com/tharsis/evmos.git &>/dev/null
cd $HOME/evmos
git checkout v0.2.0 &>/dev/null
fi
echo "Repo cloned, building..."
cd $HOME/evmos
make install &>/dev/null
echo "Build succeeded"
evmosd config chain-id evmos_9000-2 &>/dev/null
evmosd config keyring-backend file &>/dev/null
evmosd init "$EVMOS_NODENAME" --chain-id evmos_9000-2 &>/dev/null
wget -qO $HOME/.evmosd/config/genesis.json https://raw.githubusercontent.com/tharsis/testnets/main/arsia_mons/genesis.json &>/dev/null
bootstrap_node="http://5.189.156.65:26657"; \
latest_height=`wget -qO- "${bootstrap_node}/block" | jq -r ".result.block.header.height"`; \
block_height=$((latest_height - 2000)); \
trust_hash=`wget -qO- "${bootstrap_node}/block?height=${block_height}" | jq -r ".result.block_id.hash"`; \
sed -i -e "s%^moniker *=.*%moniker = \"$EVMOS_NODENAME\"%; "\
"s%^seeds *=.*%seeds = \"c36cec90ded95d162b85f8ecd00ecd7c8849ca75@arsiamons.seed.evmos.org:26656,`wget -qO - https://raw.githubusercontent.com/tharsis/testnets/main/arsia_mons/seeds.txt | tr '\n' ',' | sed 's%,$%%'`\"%; "\
"s%^persistent_peers *=.*%persistent_peers = \"[email protected]:26656,`wget -qO - https://raw.githubusercontent.com/Kallen-c/Evmos/main/peers.txt | tr '\n' ',' | sed 's%,$%%'`,`wget -qO - https://raw.githubusercontent.com/tharsis/testnets/main/arsia_mons/peers.txt | tr '\n' ',' | sed 's%,$%%'`\"%; "\
"s%^enable *=.*%enable = false%; "\
"s%^rpc_servers *=.*%rpc_servers = \"${bootstrap_node},${bootstrap_node}\"%; "\
"s%^trust_height *=.*%trust_height = $block_height%; "\
"s%^trust_hash *=.*%trust_hash = \"$trust_hash\"%" $HOME/.evmosd/config/config.toml
echo "Node config succeeded"
sudo tee <<EOF >/dev/null /etc/systemd/journald.conf
Storage=persistent
EOF
sudo systemctl restart systemd-journald
sudo tee <<EOF >/dev/null /etc/systemd/system/evmos.service
[Unit]
Description=Evmos Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which evmosd) start
Restart=always
RestartSec=10
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable evmos &>/dev/null
sudo systemctl start evmos
evmosd keys add "$EVMOS_NODENAME" --keyring-backend file
sudo systemctl stop evmos
evmosd unsafe-reset-all
rm -f $HOME/.evmosd/config/genesis.json
evmosd init "$EVMOS_NODENAME" --chain-id=evmos_9000-2
echo "Service files created, return to guide"
echo -e "\033[0m"