https://github.com/kleros/corobot
A bot to watch, notify about governor events and execute transactions
https://github.com/kleros/corobot
backend governor notifications
Last synced: about 2 months ago
JSON representation
A bot to watch, notify about governor events and execute transactions
- Host: GitHub
- URL: https://github.com/kleros/corobot
- Owner: kleros
- License: mit
- Created: 2020-03-16T13:22:38.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:44:20.000Z (over 2 years ago)
- Last Synced: 2025-03-22T16:51:04.744Z (2 months ago)
- Topics: backend, governor, notifications
- Language: TypeScript
- Homepage:
- Size: 970 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
CorobotA Bot to watch for Kleros Governor events and respond with notifications and transactions.
## Description
> Words in ALL_CAPS are environment variables. See [`.env.example`](.env.example) for more information on them.
This software consists of 6 modules that monitor the state of an instance of Kleros Governor:
### 1. Execute Approved
Executes approved transactions in the previous session.### 2. Emergency Alarm
Monitors submitted lists for the current session. If none of the submitters (WHITELISTED_ADDRESSES) made a submission during the first half of the session, this module will send emails to the watchers (WATCHERS) more and more frequently until either:
- One of the submitters (WHITELISTED_ADDRESSES) submits a list;
- One of the submitters (WHITELISTED_ADDRESSES) disarms the alarm.### 3. Pass Period
If the submission period of the current session is over is not marked as disputed, the bot will submit a transaction to execute submissions:
- If no one made a submission, it will move the governor to the next session.
- If there is only one submitted list, it will mark it as approved and move the contract to the next session.
- If there is more than one submission, it will raise a dispute.### 4. Alarm UI
The Alarm UI allows the submitters to disarm the alarm for the current session. A web3 enabled browser is required.## Prerequisites
- Tested on NodeJS version 11
## Get Started
1. Clone this repo.
2. Duplicate `.env.example`, rename it to `.env` and fill in the environment variables.
3. Run `yarn` to install dependencies and then `yarn start` to run the service in development mode.> To run the service in production mode use `yarn production`.
> To start with PM2 use `pm2 start yarn --name corobot --interpreter bash -- production`
## Other Scripts
- `yarn format` - Lint, fix and prettify all the project.
.js files with styled components and .js files.
- `yarn run cz` - Run commitizen.## Contributing
See CONTRIBUTING.md.