- Solana Client Binary
- Go 1.14.x+
- Grafana 7.x+
- Prometheus
- Node Exporter
-
Solana Client Binary Installation
Before installing prerequisites make sure to have solana client binary installed.
- If you haven't installed it before, follow this guide to install the prebuilt binaries of latest version.
To learn more about solana client binary usage click here.
-
Install other prerequisites
There are two ways of installing the prerequisites:-
- Installation script
- Manual installation
Either of the two methods can be used to install the required prerequisites. It is not necessary to do both.
1) Installation script
-
Script downloads and installs grafana, prometheus and node exporter and starts the respective servers.
-
It also downloads go if it's not already installed.
-
The script takes env variables and writes them to
config.toml
file. -
You can find the script here
-
Execute the script using the following command:
curl -s -L https://raw.githubusercontent.com/Chainflow/solana-mission-control/main/scripts/install_script.sh | bash
Source your .bashrc
after executing the script
source ~/.bashrc
Note: This script installs the prerequisites and enables them to run on their default ports ie. Grafana
by default runs on port 3000, prometheus
by default runs on port 9090 and Node Exporter
by default runs on port 9100. If you want to change the defaults ports please follow these instructions.
You can view the logs by executing the following commands:
journalctl -u grafana-server -f
journalctl -u prometheus.service -f
journalctl -u node_exporter.service -f
2) Manual installation
To manually install the prerequisites please follow this guide.
There are two ways of installing the tool:-
- Installation script
- Manual installation
Either of the two methods can be used to install the tool. It is not necessary to do both.
1) Installation script
- The script clones and sets up the monitoring tool as a system service.
- Please export the following env variables first as they will be used to initialize the
config.toml
file for the tool.
cd $HOME
export RPC_ENDPOINT="<validator-endpoint>" # Ex - export RPC_ENDPOINT="https://api.rpc.solana.com"
export NETWORK_RPC="<network-endpoint>" # Ex - export NETWORK_RPC="https://api.rpc.com"
export VALIDATOR_NAME="<moniker>" # Your validator name
export PUB_KEY="<node-Public-key>" # Ex - export PUB_KEY="valmmK7i1AxXeiTtQgQZhQNiXYU84ULeaYF1EH1pa"
export VOTE_KEY="<vote-key>" # Ex - export VOTE_KEY="2oxQJ1qpgUZU9JU84BHaoM1GzHkYfRDgDQY9dpH5mghh"
export TELEGRAM_CHAT_ID=<id> # Ex - export TELEGRAM_CHAT_ID=22128812
export TELEGRAM_BOT_TOKEN="<token>" # Ex - TELEGRAM_BOT_TOKEN="1117273891:AAE12xZU5x4JRj5YSF5LBeu1fPF0T4xj-UI"
export SOLANA_BINARY_PATH="<solana-client-binary-path>" # Ex - export SOLANA_BINARY_PATH="/home/ubuntu/.local/share/solana/install/active_release/bin/solana"
-
Note: If you don't want telegram notifications you can skip exporting
TELEGRAM_CHAT_ID
andTELEGRAM_BOT_TOKEN
but the rest are mandatory. -
You can find the tool installation script here
-
Run the script using the following command
curl -s -L https://raw.githubusercontent.com/Chainflow/solana-mission-control/main/scripts/tool_installation.sh | bash
You can check the logs of tool using:
journalctl -u solana_mc.service -f
$ git clone https://github.com/Chainflow/solana-mission-control
$ cd solana-mission-control
$ cp example.config.toml config.toml
Note : (OPTIONAL) If you wish to pass your config path from an ENV variable then you can use this command. export CONFIG_PATH="/path/to/config"
(ex: export CONFIG_PATH="/home/Desktop"
).
Edit the config.toml
with your changes. Information about all the fields in config.toml
can be found here
Note : Before running this monitoring binary, you need to add the following configuration to prometheus.yml
. You can find the prometheus file at $HOME/prometheus.yml
.
scrape_configs:
- job_name: 'solana'
static_configs:
- targets: ['localhost:1234']
Restart the prometheus serivce
$ sudo systemctl daemon-reload
$ sudo systemctl restart prometheus.service
If you wish to pass solana binary path
then you export by following below step.
export SOLANA_BINARY_PATH="<solana-client-binary-path>" # Ex - export SOLANA_BINARY_PATH="/home/ubuntu/.local/share/solana/install/active_release/bin/solana"
- Build and run the monitoring binary
$ go build -o solana-mc && ./solana-mc
- Run monitoring tool as a system service
Follow below steps to create a system service file and to start it.
Before running this make sure to export the $SOLANA_BINARY_PATH
.
echo "[Unit]
Description=Solana-mc
After=network-online.target
[Service]
User=$USER
Environment="SOLANA_BINARY_PATH=$SOLANA_BINARY_PATH"
ExecStart=$HOME/go/bin/solana-mc
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target" | sudo tee "/lib/systemd/system/solana_mc.service"
- Run the system service file
sudo systemctl daemon-reload
sudo systemctl enable solana_mc.service
sudo systemctl start solana_mc.service
Installation of the tool is completed let's configure the grafana dashboards.
The repo provides three dashboards
- Validator Monitoring Metrics - Displays the validator metrics which are calculated and stored in prometheus.
- System Monitoring Metrics - Displays the metrics related to your validator server on which this tool is hosted on.
- Summary - Displays a quick overview of validator monitoring metrics and system metrics.
Information of all the dashboards can be found here.
- Open your web browser and go to http://<your_ip>:3000/.
3000
is the default HTTP port that Grafana listens to, if you haven’t configured a different port. - If you are a first time user type
admin
for the username and password in the login page. - You can change the password after login.
-
Before importing the dashboards you have to create a
Prometheus
datasources. -
To create the datasoruce go to Configuration and select Data Sources.
-
Click on Add data source and select
Prometheus
from Time series databases section. -
Replace the URL with http://localhost:9090.
-
Click on Save & Test .
-
To import the dashboards click the + button present on left hand side of the dashboard. Click on import and paste the UID of the dashboards on the text field below Import via grafana.com and click on load.
-
Select the datasources and click on import.
UID of dashboards are as follows:
- 14738: Validator monitoring metrics dashboard.
- 14739: Summary dashboard.
- 13445: System monitoring metrics dashboard.
While importing these dashboards if you face any issues at valueset i.e., unique identifier (uid) of a dashboard, then change it to empty and then click on import by selecting the datasources.
- For more info about grafana dashboard imports you can refer https://grafana.com/docs/grafana/latest/reference/export_import/