Giter Site home page Giter Site logo

iwbinb / cosmos-proposals-checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from quokkastake/cosmos-proposals-checker

0.0 0.0 0.0 113 KB

A tool to notify you if you miss a proposal vote on any cosmos-sdk chain

License: GNU General Public License v3.0

Go 93.09% Makefile 0.51% HTML 6.40%

cosmos-proposals-checker's Introduction

cosmos-proposals-checker

Latest release Actions Status FOSSA Status

cosmos-proposals-checker is a tool that checks all configured chains for new proposals in voting period, then notifies you if one or more of the configured wallets haven't voted on it.

How can I set it up?

Download the latest release from the releases page. After that, you should unzip it, and you are ready to go:

wget <the link from the releases page>
tar <downloaded file>
./cosmos-proposals-checker --config <path to config>

Alternatively, install golang (>1.18), clone the repo and build it:

git clone https://github.com/QuokkaStake/cosmos-proposals-checker
cd cosmos-proposals-checker
# This will generate a `cosmos-proposals-checker` binary file in the repository folder
make build
# This will generate a `cosmos-proposals-checker` binary file in $GOPATH/bin

To run it detached, first we have to copy the file to the system apps folder:

sudo cp ./cosmos-proposals-checker /usr/bin

Then we need to create a systemd service for our app:

sudo nano /etc/systemd/system/cosmos-proposals-checker.service

You 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):

[Unit]
Description=Cosmos Proposals Checker
After=network-online.target

[Service]
User=<username>
TimeoutStartSec=0
CPUWeight=95
IOWeight=95
ExecStart=cosmos-proposals-checker --config <config path>
Restart=always
RestartSec=2
LimitNOFILE=800000
KillSignal=SIGTERM

[Install]
WantedBy=multi-user.target

Then we'll add this service to autostart and run it:

sudo systemctl daemon-reload # reload config to reflect changed
sudo systemctl enable cosmos-proposals-checker # put service to autostart
sudo systemctl start cosmos-proposals-checker # start the service
sudo systemctl status cosmos-proposals-checker # validate it's running

If you need to, you can also see the logs of the process:

sudo journalctl -u cosmos-proposals-checker -f --output cat

How does it work?

It queries LCD nodes for the proposals list in voting period, then for each wallet it queries its vote. If you haven't voted, it spawns an alert and sends it to configured notifiers.

How can I configure it?

All configuration is done via .toml config file, which is mandatory. Run the app with --config <path/to/config.toml> to specify config. Check out config.example.toml to see the params that can be set.

Notifiers

Currently, this program supports the following notifications channels:

  1. Telegram

Go to @BotFather in Telegram and create a bot. After that, there are two options:

  • you want to send messages to a user. This user should write a message to @getmyid_bot, then copy the Your user ID number. Also keep in mind that the bot won't be able to send messages unless you contact it first, so write a message to a bot before proceeding.
  • you want to send messages to a channel. Write something to a channel, then forward it to @getmyid_bot and copy the Forwarded from chat number. Then add the bot as an admin.

To have fancy commands auto-suggestion, go to @BotFather again, select your bot -> Edit bot -> Edit description and paste the following:

proposals - List proposals and wallets' votes on them
proposals_mute - Mutes a proposal
proposals_mutes - List active proposal mutes
help - Displays help

Then add a Telegram config to your config file (see config.example.toml for reference).

  1. PagerDuty

Go to your PagerDuty page, then go to Services. Create a service if you haven't created one already. Select this service, then go to "Integrations" tab, add an integration there. Copy the integration key and add it to the pagerduty part in config (see config.example.toml for reference). Additionally, override PagerDuty URL in config if you are using EU version.

Which networks this is guaranteed to work?

In theory, it should work on a Cosmos-based blockchains that expose a REST server.

How can I contribute?

Bug reports and feature requests are always welcome! If you want to contribute, feel free to open issues or PRs.

License

FOSSA Status

cosmos-proposals-checker's People

Contributors

fossabot avatar freak12techno avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.