Cosmogovern is a self-hosted Telegram bot designed for voting on Cosmos-based ecosystems. It leverages the x/authz module to provide secure voting capabilities.
- Bun JavaScript runtime environment
-
Install Bun:
curl -fsSL https://bun.sh/install | bash -
Build the project:
make all
This command generates a binary named
cosmogovernin the project's root directory.
-
Initialize the bot:
cosmogovern init
By default, this creates configurations and details in the
~/.cosmogoverndirectory. -
Add your keys:
cosmogovern keys add <keyname>
Note: You can use the same mnemonics for multiple chains.
-
Configure your network settings: Edit the config file (typically located in
~/.cosmogovern/config.toml) and add your chain configurations under thenetworksection. Example:[[telegram]] label = "proposal" chat_id = "<id>" [[network]] name = "cosmoshub" chain_id = "cosmoshub-4" hd_path = "m/44'/118'/0'/0/0" denom = "uatom" prefix = "cosmos" decimals = 6 wallet = "default" rpc = "https://cosmos-rpc.polkachu.com/" api = "https://cosmos-api.polkachu.com/" telegram_label = "proposal" [network.authz] granter = "" v1_vote_type = true v1_exec_type = false [network.explorer] proposal = "https://www.mintscan.io/cosmos/proposals/" tx = "https://www.mintscan.io/cosmos/txs/"
-
Grant Authz access: For security reasons, the bot uses the Cosmos ecosystem's authz functionality for voting. Follow the Keplr guide to grant permissions. After granting permission, fill in the granter address in the
network.authzsection of the config file.
To start the bot:
cosmogovern startSet the following environment variables before starting the bot:
| Variable | Description | Required/Optional |
|---|---|---|
HOME_DIR |
Specifies the home directory path for the tool | Optional |
TAG_IN_REPLAY |
Tag used in replay for reminder scenarios | Optional |
TELEGRAM_BOT_TOKEN |
Token for the Telegram bot (used for alerts/automation) | Required |
METADATA |
Metadata related to votes, stored for reference | Optional |
MONITORING_INTERVAL |
Interval (in seconds) for monitoring checks/updates | Optional (Default: 5) |
Cosmogovern has been tested on:
- Locally spun Cosmos SDK-based chains
- Nibiru Mainnet: Transaction
For more information or support, please refer to the project's GitHub repository or contact the maintainers.