An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        


Corobot


JavaScript Style Guide
Conventional Commits
Commitizen Friendly
Styled with Prettier

A 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.