Skip to content

A self-hosted Telegram bot designed for voting on Cosmos-based ecosystems

Notifications You must be signed in to change notification settings

Luganodes/Cosmogovern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosmogovern Documentation

Table of Contents

  1. Introduction
  2. Installation
  3. Configuration
  4. Usage
  5. Environment Variables
  6. Tested Networks

Introduction

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.

Installation

Prerequisites

  • Bun JavaScript runtime environment

Build from Source

  1. Install Bun:

    curl -fsSL https://bun.sh/install | bash
  2. Build the project:

    make all

    This command generates a binary named cosmogovern in the project's root directory.

Configuration

  1. Initialize the bot:

    cosmogovern init

    By default, this creates configurations and details in the ~/.cosmogovern directory.

  2. Add your keys:

    cosmogovern keys add <keyname>

    Note: You can use the same mnemonics for multiple chains.

  3. Configure your network settings: Edit the config file (typically located in ~/.cosmogovern/config.toml) and add your chain configurations under the network section. 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/"
  4. 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.authz section of the config file.

Usage

To start the bot:

cosmogovern start

Environment Variables

Set 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)

Tested Networks

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.

About

A self-hosted Telegram bot designed for voting on Cosmos-based ecosystems

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •