Corobot
A Bot to watch for Kleros Governor events and respond with notifications and transactions.
Words in ALL_CAPS are environment variables. See
.env.example
for more information on them.
This software consists of 6 modules that monitor the state of an instance of Kleros Governor:
Executes approved transactions in the previous session.
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.
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.
The Alarm UI allows the submitters to disarm the alarm for the current session. A web3 enabled browser is required.
- Tested on NodeJS version 11
- Clone this repo.
- Duplicate
.env.example
, rename it to.env
and fill in the environment variables. - Run
yarn
to install dependencies and thenyarn 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
yarn format
- Lint, fix and prettify all the project. .js files with styled components and .js files.yarn run cz
- Run commitizen.
See CONTRIBUTING.md.