{"id":13564702,"url":"https://github.com/solarlabsteam/cosmos-exporter","last_synced_at":"2025-12-27T05:38:17.902Z","repository":{"id":41358948,"uuid":"362800581","full_name":"solarlabsteam/cosmos-exporter","owner":"solarlabsteam","description":"Scrape the data about the validators set, specific validators or wallets in the Cosmos network. ","archived":false,"fork":false,"pushed_at":"2023-10-10T15:55:00.000Z","size":550,"stargazers_count":70,"open_issues_count":17,"forks_count":65,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-24T04:15:08.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solarlabsteam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-29T11:54:56.000Z","updated_at":"2024-01-13T06:58:47.000Z","dependencies_parsed_at":"2024-01-03T05:20:08.879Z","dependency_job_id":"da6dcb2b-4bd2-4cf7-942c-e90d3adcb0fc","html_url":"https://github.com/solarlabsteam/cosmos-exporter","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarlabsteam%2Fcosmos-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarlabsteam%2Fcosmos-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarlabsteam%2Fcosmos-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solarlabsteam%2Fcosmos-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solarlabsteam","download_url":"https://codeload.github.com/solarlabsteam/cosmos-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247083345,"owners_count":20880817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:34.647Z","updated_at":"2025-12-27T05:38:17.872Z","avatar_url":"https://github.com/solarlabsteam.png","language":"Go","funding_links":[],"categories":["Monitoring","Go"],"sub_categories":["External Modules","Terminal Block Explorers"],"readme":"# cosmos-exporter\n\n![Latest release](https://img.shields.io/github/v/release/solarlabsteam/cosmos-exporter)\n[![Actions Status](https://github.com/solarlabsteam/cosmos-exporter/workflows/test/badge.svg)](https://github.com/solarlabsteam/cosmos-exporter/actions)\n\ncosmos-exporter is a Prometheus scraper that fetches the data from a full node of a Cosmos-based blockchain via gRPC.\n\n## What can I use it for?\n\nYou can run a full node, run cosmos-exporter on the same host, set up Prometheus to scrape the data from it (see below for instructions), then set up Grafana to visualize the data coming from the exporter and probably add some alerting. Here are some examples of Grafana dashboards we created for ourselves:\n\n![Validator dashboard](https://raw.githubusercontent.com/solarlabsteam/cosmos-exporter/master/images/dashboard_validator.png)\n![Validators dashboard](https://raw.githubusercontent.com/solarlabsteam/cosmos-exporter/master/images/dashboard_validators.png)\n![Wallet dashboard](https://raw.githubusercontent.com/solarlabsteam/cosmos-exporter/master/images/dashboard_wallet.png)\n\n## How can I set it up?\n\nFirst of all, you need to download the latest release from [the releases page](https://github.com/solarlabsteam/cosmos-exporter/releases/). After that, you should unzip it and you are ready to go:\n\n```sh\nwget \u003cthe link from the releases page\u003e\ntar xvfz cosmos-exporter-*\n./cosmos-exporter\n```\n\nThat's not really interesting, what you probably want to do is to have it running in the background. For that, first of all, we have to copy the file to the system apps folder:\n\n```sh\nsudo cp ./cosmos-exporter /usr/bin\n```\n\nThen we need to create a systemd service for our app:\n\n```sh\nsudo nano /etc/systemd/system/cosmos-exporter.service\n```\n\nYou can use this template (change the user to whatever user you want this to be executed from. It's advised to create a separate user for that instead of running it from root):\n\n```\n[Unit]\nDescription=Cosmos Exporter\nAfter=network-online.target\n\n[Service]\nUser=\u003cusername\u003e\nTimeoutStartSec=0\nCPUWeight=95\nIOWeight=95\nExecStart=cosmos-exporter\nRestart=always\nRestartSec=2\nLimitNOFILE=800000\nKillSignal=SIGTERM\n\n[Install]\nWantedBy=multi-user.target\n```\n\nThen we'll add this service to the autostart and run it:\n\n```sh\nsudo systemctl enable cosmos-exporter\nsudo systemctl start cosmos-exporter\nsudo systemctl status cosmos-exporter # validate it's running\n```\n\nIf you need to, you can also see the logs of the process:\n\n```sh\nsudo journalctl -u cosmos-exporter -f --output cat\n```\n\n## How can I scrape data from it?\n\nHere's the example of the Prometheus config you can use for scraping data:\n\n```yaml\nscrape-configs:\n  # specific validator(s)\n  - job_name:       'validator'\n    scrape_interval: 15s\n    metrics_path: /metrics/validator\n    static_configs:\n      - targets:\n        - \u003clist of validators you want to monitor\u003e\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_address\n      - source_labels: [__param_address]\n        target_label: instance\n      - target_label: __address__\n        replacement: \u003cnode hostname or IP\u003e:9300\n  # specific wallet(s)\n  - job_name:       'wallet'\n    scrape_interval: 15s\n    metrics_path: /metrics/wallet\n    static_configs:\n      - targets:\n        - \u003clist of wallets\u003e\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_address\n      - source_labels: [__param_address]\n        target_label: instance\n      - target_label: __address__\n        replacement: \u003cnode hostname or IP\u003e:9300\n\n  # all validators\n  - job_name:       'validators'\n    scrape_interval: 15s\n    metrics_path: /metrics/validators\n    static_configs:\n      - targets:\n        - \u003cnode hostname or IP\u003e:9300\n```\n\nThen restart Prometheus and you're good to go!\n\nAll of the metrics provided by cosmos-exporter have the following prefixes:\n- `cosmos_validator_*` - metrics related to a single validator\n- `cosmos_validators_*` - metrics related to a validator set\n- `cosmos_wallet_*` - metrics related to a single wallet\n\n## How does it work?\n\nIt queries the full node via gRPC and returns it in the format Prometheus can consume.\n\n## How can I configure it?\n\nYou can pass the artuments to the executable file to configure it. Here is the parameters list:\n\n- `--bech-prefix` - the global prefix for addresses. Defaults to `persistence`\n- `--denom` - the currency, for example, `uatom` for Cosmos. Defaults to `uxprt`\n- `--denom-coefficient` - the number of decimals, `1000000` for cosmos. Defaults to `1`. Can't provide along with `--denom-exponent`\n- `--denom-exponent` - the denom exponent, `6` for cosmos. Defaults to `0`. Can't provide along with `--denom-coefficient`\n- `--listen-address` - the address with port the node would listen to. For example, you can use it to redefine port or to make the exporter accessible from the outside by listening on `127.0.0.1`. Defaults to `:9300` (so it's accessible from the outside on port 9300)\n- `--node` - the gRPC node URL. Defaults to `localhost:9090`\n- `--tendermint-rpc` - Tendermint RPC URL to query node stats (specifically `chain-id`). Defaults to `http://localhost:26657`\n- `--log-devel` - logger level. Defaults to `info`. You can set it to `debug` to make it more verbose.\n- `--limit` - pagination limit for gRPC requests. Defaults to 1000.\n- `--json` - output logs as JSON. Useful if you don't read it on servers but instead use logging aggregation solutions such as ELK stack.\n\n\nYou can also specify custom Bech32 prefixes for wallets, validators, consensus nodes, and their pubkeys by using the following params:\n- `--bech-account-prefix`\n- `--bech-account-pubkey-prefix`\n- `--bech-validator-prefix`\n- `--bech-validator-pubkey-prefix`\n- `--bech-consensus-node-prefix`\n- `--bech-consensus-node-pubkey-prefix`\n\nBy default, if not specified, it defaults to the next values (as it works this way for the most of the networks):\n- `--bech-account-prefix` = `--bech-prefix`\n- `--bech-account-pubkey-prefix` = `--bech-prefix` + \"pub\"\n- `--bech-validator-prefix`  = `--bech-prefix` + \"valoper\"\n- `--bech-validator-pubkey-prefix` = `--bech-prefix` + \"valoperpub\"\n- `--bech-consensus-node-prefix` = `--bech-prefix` + \"valcons\"\n- `--bech-consensus-node-pubkey-prefix` = `--bech-prefix` + \"valconspub\"\n\nAn example of the network where you have to specify all the prefixes manually is Iris, check out the flags example below.\n\nAdditionally, you can pass a `--config` flag with a path to your config file (I use `.toml`, but anything supported by [viper](https://github.com/spf13/viper) should work).\n\n## Which networks this is guaranteed to work?\n\nIn theory, it should work on a Cosmos-based blockchains with cosmos-sdk \u003e= 0.40.0 (that's when they added gRPC and IBC support). If this doesn't work on some chains, please file and issue and let's see what's up.\n\n## How can I contribute?\n\nBug reports and feature requests are always welcome! If you want to contribute, feel free to open issues or PRs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarlabsteam%2Fcosmos-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolarlabsteam%2Fcosmos-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolarlabsteam%2Fcosmos-exporter/lists"}