Coder Social home page Coder Social logo

kleros / corobot Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 1.0 993 KB

A bot to watch, notify about governor events and execute transactions

License: MIT License

JavaScript 13.02% HTML 7.64% CSS 2.77% TypeScript 70.98% Shell 5.59%
backend governor notifications

corobot's Introduction

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

corobot's People

Contributors

dependabot[bot] avatar eccentricexit avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

pinkdiamond1

corobot's Issues

Bot improvements

  • Bot should not watch for one, but a list of addresses.
  • Add a simple UI to "disarm" the alarm. A white listed should be allowed to click it.
  • At the end of the submission period, if no one submitted, the bot should send an empty list.
  • The bot should also call executeTransactionList()

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.