forked from sei-protocol/sei-cosmos-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-sei-cosmos-exporter.sh
42 lines (33 loc) · 1.03 KB
/
install-sei-cosmos-exporter.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
#!/usr/bin/env bash
BOND_DENOM=usei
BENCH_PREFIX=sei
echo -e "\e[1m\e[32m1. Installing cosmos-exporter... \e[0m" && sleep 1
source ~/.bashrc
# install cosmos-exporter
sudo /usr/local/go/bin/go build -o build/sei-cosmos-exporter -buildvcs=false ./
sudo /usr/bin/go build -o build/sei-cosmos-exporter -buildvcs=false ./
sudo go build -o build/sei-cosmos-exporter -buildvcs=false ./
sudo mv ./build/sei-cosmos-exporter /usr/bin
sudo useradd -rs /bin/false cosmos_exporter
sudo tee <<EOF >/dev/null /etc/systemd/system/cosmos-exporter.service
[Unit]
Description=Cosmos Exporter
After=network-online.target
[Service]
User=cosmos_exporter
Group=cosmos_exporter
TimeoutStartSec=0
CPUWeight=95
IOWeight=95
ExecStart=/usr/bin/sei-cosmos-exporter --denom $BOND_DENOM --denom-coefficient 1000000 --bech-prefix $BENCH_PREFIX
Restart=always
RestartSec=2
LimitNOFILE=800000
KillSignal=SIGTERM
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable cosmos-exporter
sudo systemctl restart cosmos-exporter
echo "installed"