Home

Awesome

SUIMON: Command Line Tool for Monitoring SUI Network

<div style="text-align:center;"> <img src="static/images/suimon.png" alt="Image Description" width="1000"/> <p align="center"> <a href="https://github.com/bartosian/suimon/releases/latest"> <img alt="GitHub release" src="https://img.shields.io/github/v/release/bartosian/suimon.svg?logo=github&style=flat-square"> </a> <a href="https://goreportcard.com/report/github.com/bartosian/suimon"> <img src="https://goreportcard.com/badge/github.com/bartosian/suimon" alt="Go Report Card"> </a> </p> </div>

Suimon is a powerful command line tool designed to provide detailed dashboards for monitoring the SUI network. With Suimon, you can easily monitor your nodes' and validators' health and performance and track important system states and events in real time.

Whether you're a network operator, validator, or simply a curious observer, Suimon offers a range of powerful monitoring capabilities that can help you stay on top of the SUI network. From node status and uptime monitoring to detailed performance metrics and system state tracking, Suimon provides everything you need to ensure your network runs smoothly and efficiently.

So if you're looking for a powerful, reliable tool for monitoring the SUI network, look no further than Suimon. Try it out today and start monitoring your network with confidence!

Table of Contents

Installation

There are installation scripts for several common environments, including Ubuntu, Mac OS, and Windows. These scripts are provided for convenience only and do not guarantee that Suimon will run without issues on your system.

Ubuntu

wget -O $HOME/suimon_install.sh https://raw.githubusercontent.com/bartosian/suimon/main/scripts/ubuntu/install.sh && \
chmod +x $HOME/suimon_install.sh && \
$HOME/suimon_install.sh && \
rm $HOME/suimon_install.sh

MacOS

curl -o $HOME/suimon_install.sh https://raw.githubusercontent.com/bartosian/suimon/main/scripts/macos/install.sh && \
chmod +x $HOME/suimon_install.sh && \
$HOME/suimon_install.sh && \
rm $HOME/suimon_install.sh

Windows

Invoke-WebRequest -OutFile $HOME\suimon_install.ps1 https://raw.githubusercontent.com/bartosian/suimon/main/scripts/windows/install.ps1 ; \
powershell -ExecutionPolicy Bypass -File $HOME\suimon_install.ps1 ; \
Remove-Item $HOME\suimon_install.ps1

Build and Installation from Source

Building and installing from the source is useful if you want to customize the code or if there is no pre-built binary available for your platform. It can also be a good learning experience if you are interested in how Suimon works.

  1. Install Go

    • The Suimon installation requires Go. If you don't already have Go installed, please visit https://golang.org/dl and https://go.dev/doc/install for instructions on how to download and install Go on your system. Download the binary release that is suitable for your system and follow the installation instructions.
  2. Clone the Suimon repository

    • Clone the Suimon repository by running the following command in your terminal:
      cd $HOME && \
      git clone https://github.com/bartosian/suimon.git && \
      cd suimon
      
  3. Install packages and dependencies

    • Install packages and dependencies required by the Suimon tool by running the following command:
      go get -u ./...
      
  4. Build the Suimon package

    • Build the Suimon package by running the following command:
      go build -o suimon .
      
  5. Move the built binary to the executable PATH

    • Move the suimon binary to a directory that's listed in your executable PATH to make it easy to run the Suimon tool from anywhere in your terminal. You can find the list of directories in your executable PATH by running the following command in your terminal:
      echo $PATH
      
    • For example, if the output of the echo $PATH command includes /usr/local/bin, you can move the suimon binary to this directory by running the following command:
      mv suimon /usr/local/bin/
      
    • If you're not sure which directory to use, you can create a new directory in your home directory called bin by running the following command:
      mkdir $HOME/bin
      
      Then, add the bin directory to your executable PATH by adding the following line to your shell configuration file (e.g. ~/.bashrc for Bash or ~/.zshrc for Zsh):
      export PATH=$PATH:$HOME/bin
      
      Finally, move the suimon binary to the bin directory by running the following command:
      mv suimon $HOME/bin/
      
  6. Create a Suimon config directory and put the config file there

    • Create a directory for your Suimon config files by running the following command:

      mkdir $HOME/.suimon && \
      cp $HOME/suimon/main/static/templates/suimon-testnet.yaml $HOME/.suimon/suimon-testnet.yaml
      

      The 'suimon-testnet.yaml' file that you have just copied is a template file and must be customized with your specific environment data before running the Suimon tool.

    • For each network that you want to connect to, create a separate YAML file with the naming convention suimon-<network>.yaml and put it in the .suimon directory. For example, if you want to connect to the mainnet, you can create a file called suimon-mainnet.yaml and put it in the .suimon directory.

Installation using Homebrew

For macOS users, suimon can be seamlessly installed using the Homebrew package manager. Please adhere to the subsequent steps to facilitate the installation.

  1. Tap into the Repository

    • To access the necessary formulae for the installation, you'll need to first tap into our repository:
      brew tap bartosian/tools
      
  2. Initiate the Installation

    • With the repository tapped, proceed to install Suimon:
      brew install suimon
      
  3. Post-installation Configuration

    • Following the installation, it's essential to set up the suimon configuration file. Detailed instructions for this setup are provided in the subsequent section of this document. Upon completion of these steps, suimon will be configured and ready for use on your macOS system.

Upgrading Suimon using Homebrew

For macOS users who have previously installed Suimon via Homebrew, upgrading to the latest version can be done efficiently. Follow these steps to ensure Suimon is up-to-date and functioning optimally.

  1. Update Homebrew Repository

    • Before upgrading, ensure your Homebrew repository is up to date:
      brew update
      
  2. Upgrade Suimon

    • Once the repository is updated, proceed to upgrade Suimon:
      brew upgrade suimon
      
  3. Verify the Upgrade

    • After the upgrade, it's a good practice to check the installed version of Suimon:
      suimon version
      

Occasionally, cache-related issues might occur, causing problems with the installation or upgrade process. To resolve these issues:

  1. Clear Homebrew Cache

    • Clear the Homebrew cache to remove any corrupted or outdated files:
      brew cleanup
      
  2. Reinstall Suimon (Optional)

    • If issues persist after cleaning the cache, a fresh reinstall of Suimon might be necessary:
      brew reinstall suimon
      

For macOS users, suimon can be seamlessly installed using the Homebrew package manager. Please adhere to the subsequent steps to facilitate the installation.

Suimon Configuration Files

Suimon uses configuration files to manage settings and defaults for different environments and networks. The default configuration file for the Suimon tool is suimon-testnet.yaml, which is located in the ~/.suimon directory. However, you can use multiple configuration files to manage settings for different networks and environments.

By properly configuring your Suimon configuration file, you can reduce the need for command-line interface (CLI) flags when running the tool. The configuration file can contain default values and settings that are automatically applied to the tool when it is executed. This can streamline your workflow and reduce the amount of time and effort required to run the tool.

You can also provide a different location for the configuration files by using the SUIMON_CONFIG_PATH environment variable to the desired configuration directory path. This allows you to customize the location of the configuration files to your needs, such as if you want to store it in a specific directory or share it with others in a different location.

To manage settings for different networks and environments, create separate configuration files with the naming convention suimon-<network>.yaml and put them in the ~/.suimon directory. For example, if you want to connect to the mainnet, you can create a file called suimon-mainnet.yaml and put it in the .suimon directory.

Example Suimon Config Directory

The names for these configuration files are up to the user. In this example, we've used the naming convention suimon-<network>.yaml to provide an example of how to name configuration files for different networks.

Here is an example file tree for the ~/.suimon directory with separate configuration files for all sui networks:

~/.suimon
├── suimon-testnet.yaml
├── suimon-devnet.yaml
└── suimon-mainnet.yaml

Suimon Configuration Fields

Suimon configuration files contain fields that allow you to customize the behavior of the tool to fit your specific use case. These files also enable you to add or remove monitored network entities and specify how they should be monitored. The suimon-testnet.yaml file, for instance, is a template configuration file that you can use as a starting point to create your own configuration file for testnet network. Before using Suimon, be sure to modify the configuration file with your own data and settings.

# This section lists the public RPC endpoints that the client will use to monitor the network and calculate the health of the nodes and validators.
# Please make sure to provide at least one working endpoint.
public-rpc:
  - https://fullnode.testnet.sui.io:443
  - https://rpc-ws-testnet-w3.suiprovider.xyz:443
  - https://sui-api.rpc.com:443

# if you wish to monitor the nodes, update this section with the nodes information
full-nodes:
  - json-rpc-address: 0.0.0.0:9000
    metrics-address: 0.0.0.0:9184
  - json-rpc-address: https://sui-rpc.testnet.com
    metrics-address: https://sui-rpc.testnet.com/metrics

# if you wish to monitor the validators, update this section with the validators information
validators:
  - metrics-address: 0.0.0.0:9184/metrics
  - metrics-address: https://sui-validator.testnet.com:9184/metrics
  - metrics-address: https://sui-validator.testnet.com:9184/metrics

# provider and country information in tables is requested from https://ipinfo.io/ public API. To use it, you need to obtain an access token on the website,
# which is free and gives you 50k requests per month, which is sufficient for individual usage.
ip-lookup:
  access-token: 55f30ce0213aa7 # temporary access token with requests limit
  1. public-rpc

The public-rpc section lists the public RPC endpoints that the client will use to monitor the network and calculate the health of the nodes and validators. Therefore, it is essential to provide accurate and up-to-date endpoint information in this section. This field is required to request system metrics and to calculate the health of nodes and validators. The other fields are optional and can be updated if needed.

public-rpc:
  - https://wave3-rpc.testnet.sui.io:443"
  - https://rpc-ws-testnet-w3.suiprovider.xyz:443
  - https://sui-api.rpc.com:443

These endpoints are managed by the SUI team, which you can use alongside your own to monitor the relevant networks.

NetworkRPC Endpoint
Devnethttps://fullnode.devnet.sui.io
Testnethttps://fullnode.testnet.sui.io
Mainnethttps://fullnode.mainnet.sui.io
  1. full-nodes

The full-nodes section lists the full nodes for monitoring in the SUI network. The user can update this section with information for any number of nodes, following the example format provided. It is important to note that the RPC address is required to be provided for each node, while the metrics address is optional.

full-nodes:
  - json-rpc-address: 0.0.0.0:9000
    metrics-address: 0.0.0.0:9184
  - json-rpc-address: https://sui-rpc.testnet.com
    metrics-address: https://sui-rpc.testnet.com/metrics
  1. validators

The validators section lists the validators to monitor. The user can update this section with information for any number of validators, following the example format provided. It is important to note that only the metrics endpoint is required to be provided for each validator.

validators:
  - metrics-address: 0.0.0.0:9184/metrics
  - metrics-address: https://sui-validator.testnet.com:9184/metrics
  - metrics-address: https://sui-validator.mainnet.com:9184/metrics
  1. ip-lookup

The ip-lookup section provides information on how to use the ipinfo.io public API to get provider and country information in tables. The user needs to obtain an access token on the website to use this feature. The current access token provided is temporary with a limited number of requests per month.

ip-lookup:
  access-token: 55f30ce0213aa7 # temporary access token with requests limit

Suimon Commands

The Suimon tool provides several commands that offer capabilities to monitor the SUI network and its entities. Here is an overview of the main commands:

Tables

Tables are static monitors that provide a detailed snapshot of the network and its entities at a certain point in time.

Table TypeDescription
📡 PUBLIC RPCDisplays detailed information about the network's RPC endpoints.
💻 FULL NODESDisplays detailed information about the network's nodes.
🤖 VALIDATORSDisplays detailed information about the network's validators.
💾 SYSTEM STATEDisplays the current gas price and subsidy values in the network.
🌐 PROTOCOLDisplays the protocol config for the latest version number.
📊 VALIDATORS PARAMSDisplays the validators related thresholds and counts on the network.
🚨 VALIDATORS AT RISKDisplays the number of validators that are currently at risk of being slashed.
📢 VALIDATORS REPORTSDisplays the latest reports submitted by validators.
✅ ACTIVE VALIDATORSDisplays the current list of active validators on the network.
📈 RELEASE HISTORYDisplays the release history for the selected network.

Table Examples

Dashboards

Dashboards are dynamic monitors that provide real-time information about the network and its entities. Unlike static tables, which provide a snapshot of the network at a specific point in time, dashboards continuously update and display data in real-time.

Dashboard TypeDescription
📡 PUBLIC RPCDisplays detailed information about the network's RPC endpoints.
💻 FULL NODESDisplays detailed information about the network's nodes.
🤖 VALIDATORSDisplays detailed information about the network's validators.
💾 SYSTEM STATEDisplays the current gas price and subsidy values for the network.

Dashboard Examples

License

This project is licensed under the MIT License. You are free to use, modify, and distribute this code, as long as you give credit to the original source.

Acknowledgments

This project is based on the work of bartosian. If you use this code, please give credit to the original source.