Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/P-OPSTeam/cosmos-governance-alerter
Cosmos Governance vote alerter
https://github.com/P-OPSTeam/cosmos-governance-alerter
Last synced: 12 days ago
JSON representation
Cosmos Governance vote alerter
- Host: GitHub
- URL: https://github.com/P-OPSTeam/cosmos-governance-alerter
- Owner: P-OPSTeam
- Created: 2023-07-16T13:22:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-28T13:57:32.000Z (3 months ago)
- Last Synced: 2024-10-28T17:10:57.526Z (3 months ago)
- Language: Python
- Size: 32.2 KB
- Stars: 5
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Governance: governance_vote.py
Awesome Lists containing this project
- awesome-ccamel - P-OPSTeam/cosmos-governance-alerter - Cosmos Governance vote alerter (Python)
README
# Governance Vote Alerter
## Description
Cosmos Governance vote alerter## Installation
```bash
cd ~
git clone https://github.com/P-OPSTeam/cosmos-governance-alerter.git
sudo apt update
sudo apt install python3 python3-virtualenv
cd cosmos-governance-alerter
virtualenv -p /usr/bin/python3 .venv
source .venv/bin/activate
curl -sS https://bootstrap.pypa.io/get-pip.py | python3
pip install -r requirements.txt
```## Configuration
```bash
cp config.json.example config.json
```Use your favorite editor and edit config.json
- under app_config :
- `timeout` represent how long we should wait before the next vote checks
- `votes_file` is the filename that stores all the on-going vote in all supported network
- `format`: The format of the log messages. Can be `json` or `text`.
- `level`: The log level. Can be `DEBUG`, `INFO`, `WARNING`, `ERROR`, or `CRITICAL`.
- `default_pagination_limit`: The default number of proposal the program will fetch per request
- `prometheus_port`: The port for the prometheus metrics
- under alerts_config
- set to `true` the integration you would like to enable, and make sure to fill up the requirement information
- under chain_config and for each network :
- `api_endpoint` is the governance api endpoint that list all the proposals
- `network` is only used to provide more information in the alert
- `explorer_governance` is the link without the proposal ID, ie program will add /
- `pagination_limit` is the number of proposal the program will fetch per request (optional, default is 100)## Prometheus metrics
Prometheus metrics are available at http://localhost:, PROMETEHEUS_PORT is the port from the app_config.prometheus_port
```bash
curl http://localhost:
```
Example of metrics
```bash
governance_votes_api_req_status_total{api_endpoint="https://rest.cosmos.directory/haqq/cosmos/gov/v1beta1/proposals",name="haqq",network="mainnet",status="success"} 1.0
```
The status value can be success or failed## TODO
- [ ] Add a license