Giter Site home page Giter Site logo

pessimism's Introduction

pessimism

Because you can't always be optimistic

Pessimism is a public good monitoring service that allows for Op-Stack and EVM compatible blockchains to be continously assessed for real-time threats using customly defined user invariant rulesets. To learn about Pessimism's architecture, please advise the documentation.

GitHub contributors GitHub commit activity GitHub Stars GitHub repo size GitHub

GitHub pull requests by-label GitHub Issues

Warning: Pessimism is currently experimental and very much in development. It means Pessimism is currently unstable, so code will change and builds can break over the coming months. If you come across problems, it would help greatly to open issues so that we can fix them as quickly as possible.

Setup

To use the template, run the following the command(s):

  1. Create local config file (config.env) to store all necessary environmental variables. There's already an example config.env.template in the repo that stores default env vars.

  2. Download or upgrade to golang 1.19.

  3. Install all project golang dependencies by running go mod download.

To Run

  1. Compile pessimism to machine binary by running the following project level command(s):

    • Using Make: make build-app
  2. To run the compiled binary, you can use the following project level command(s):

    • Using Make: make run-app
    • Direct Call: ./bin/pessimism

Linting

golangci-lint is used to perform code linting. Configurations are defined in .golangci.yml It can be ran using the following project level command(s):

  • Using Make: make lint
  • Direct Call: golangci-lint run

Testing

Unit Tests

Unit tests are written using the native go test library with test mocks generated using the golang native mock library.

Unit tests can ran using the following project level command(s):

  • Using Make: make test
  • Direct Call: go test ./...

Integration Tests

TBD

Bootstrap Config

A bootstrap config file is used to define the initial state of the pessimism service. The file must be json formatted with it's directive defined in the BOOTSTRAP_PATH env var.

Example

[
    {
          "network": "layer1",
          "pipeline_type": "live",
          "type": "contract_event", 
          "start_height": null,
          "alert_destination": "slack",
          "invariant_params": {
              "address": "0xfC0157aA4F5DB7177830ACddB3D5a9BB5BE9cc5e",
              "args": ["Transfer(address, address, uint256)"]
        }
    },
    {
        "network": "layer1",
        "pipeline_type": "live",
        "type": "balance_enforcement", 
        "start_height": null,
        "alert_destination": "slack",
        "invariant_params": {
            "address": "0xfC0157aA4F5DB7177830ACddB3D5a9BB5BE9cc5e",
            "lower": 1,
            "upper": 2
       }
    }
]

Spawning an invariant session

To learn about the currently supported invariants and how to spawn them, please advise the invariants documentation.

pessimism's People

Contributors

nadir-akhtar-coinbase avatar adrain-cb avatar ale-coinbase avatar the-amazing-atharva avatar vavrajosef avatar anupsv-cb avatar dependabot[bot] 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.