Skip to content

MANTRA-Chain/cosmos-upgrade-watcher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosmos Upgrade Watcher

Cosmos Upgrade Watcher is a Rust program that monitors the upcoming upgrade status of Cosmos SDK chains. It fetches upgrade information from a specified API endpoint, filters the upgrades based on a watch list, and exposes the upgrade information as Prometheus metrics.

Features

  • Fetches upgrade information from a specified API endpoint.
  • Filters upgrades based on a configurable watch list.
  • Exposes upgrade information as Prometheus metrics.
  • Removes expired metrics based on the estimated upgrade time.

Configuration

The program uses a configuration file in TOML format. Below is an example configuration file (config.toml):

[prometheus]
host = '127.0.0.1'
port = 9090

[chain]
watch_list = [
  'cosmos',
  'osmosis',
  'stargaze',
  'mantra',
]
refresh = '60s'
endpoint = 'https://polkachu.com/api/v2/chain_upgrades'
  • prometheus.host: The host address for the Prometheus metrics server.
  • prometheus.port: The port for the Prometheus metrics server.
  • chain.watch_list: A list of networks to watch for upgrades.
  • chain.refresh: The interval at which to refresh the upgrade information.
  • chain.endpoint: The API endpoint to fetch the upgrade information.

Usage

  1. Clone the repository:
git clone https://github.com/allthatjazzleo/cosmos-upgrade-watcher.git
cd cosmos-upgrade-watcher
  1. Create a configuration file (config.toml) in the root directory with the desired settings.

  2. Build and run the program:

cargo build --release
./target/release/cosmos-upgrade-watcher -c config.toml
  1. The Prometheus metrics will be available at http://127.0.0.1:9090/metrics (or the configured host and port).

Running Tests

To run the unit tests, use the following command:

cargo test

License

This project is licensed under the Mozilla Public License. See the LICENSE file for details.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 94.5%
  • Dockerfile 5.5%