forked from Chainflow/cosmos-validator-mission-control
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_script.sh
67 lines (38 loc) · 1.63 KB
/
install_script.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
set -e
cd $HOME
teleFalg="$1"
teleFlagValue="--remote-hosted"
echo "----------- Installing grafana -----------"
sudo -S apt-get install -y adduser libfontconfig1
wget https://dl.grafana.com/oss/release/grafana_6.7.2_amd64.deb
sudo -S dpkg -i grafana_6.7.2_amd64.deb
echo "------ Starting grafana server using systemd --------"
sudo -S systemctl daemon-reload
sudo -S systemctl start grafana-server
cd $HOME
echo "----------- Installing Influx -----------"
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/lsb-release
echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo -S apt-get update && sudo apt-get install influxdb
sudo -S service influxdb start
cd $HOME
if [ "$teleFalg" != "$teleFlagValue" ];
then
echo "----------- Installing telegraf -----------------"
sudo -S apt-get update && sudo apt-get install telegraf
sudo -S service telegraf start
else
echo "------remote-hosted enabled, so not downloading the telegraf--------"
fi
echo "------------Creating databases vcf and telegraf-------------"
curl "http://localhost:8086/query" --data-urlencode "q=CREATE DATABASE vcf"
curl "http://localhost:8086/query" --data-urlencode "q=CREATE DATABASE telegraf"
echo "--------- Cloning cosmos-validator-mission-control -----------"
cd go/src/github.com
git clone https://github.com/Chainflow/cosmos-validator-mission-control.git
cd cosmos-validator-mission-control
cp example.config.toml config.toml
echo "------ Building and running the code --------"
go build && ./cosmos-validator-mission-control