-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddon.sh
67 lines (47 loc) · 2.62 KB
/
addon.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
#!/bin/bash
echo "=================================================="
echo -e "\e[1m\e[32m1. Качаю генезис \e[0m" && sleep 1
wget -O $HOME/.sei/config/genesis.json "https://raw.githubusercontent.com/sei-protocol/testnet/master/sei-incentivized-testnet/genesis.json"
echo "=================================================="
echo -e "\e[1m\e[32m2. Качаю addrbook \e[0m" && sleep 1
wget -O $HOME/.sei/config/addrbook.json "https://raw.githubusercontent.com/sei-protocol/testnet/master/sei-incentivized-testnet/addrbook.json"
echo "=================================================="
echo -e "\e[1m\e[32m3. Настраиваю конфиг \e[0m" && sleep 1
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0025usei\"/;" ~/.sei/config/app.toml
external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.sei/config/config.toml
echo "=================================================="
echo -e "\e[1m\e[32m4. Добавляю пиры \e[0m" && sleep 1
peers="[email protected]:36656,[email protected]:26656,[email protected]:51656,[email protected]:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.sei/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.sei/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 100/g' $HOME/.sei/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 100/g' $HOME/.sei/config/config.toml
echo "=================================================="
echo -e "\e[1m\e[32m5. Создаю сервисный файл \e[0m" && sleep 1
source ~/.bash_profile
sleep 1
echo "[Unit]
Description=seid
After=network-online.target
[Service]
User=$USER
ExecStart=$(which seid) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target" > $HOME/seid.service
mv $HOME/seid* /etc/systemd/system/
echo "=================================================="
echo -e "\e[1m\e[32m5. Оптимизирую \e[0m" && sleep 1
wget -qO optimize-configs.sh "https://raw.githubusercontent.com/sei-protocol/testnet/main/sei-testnet-2/optimize-configs.sh"
sudo chmod +x optimize-configs.sh && ./optimize-configs.sh
sudo systemctl restart seid
sleep 30
sudo systemctl daemon-reload
sudo systemctl enable seid
seid tendermint unsafe-reset-all --home $HOME/.sei
sudo systemctl restart seid
echo -e "\e[1m\e[32m6. Все готово \e[0m" && sleep 1