GithubHelp home page GithubHelp logo

isabella232 / thegraph-subgraphs-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gnosis/thegraph-subgraphs-monitor

0.0 0.0 0.0 24 KB

Monitor subgraphs from https://thegraph.com/

License: MIT License

Dockerfile 4.87% Python 91.73% Shell 3.40%

thegraph-subgraphs-monitor's Introduction

Python 3.8

Thegraph Subgraphs monitor

A monitor system to check statuses of subgraphs that are running on Thegraph platform.

What exactly things does it monitor?

  • CURRENT subgraph version. This is the subgraph version that is used to answer requests to graphql endpoint.
  • PENDING subgraph version. This is the subgraph version that will replace the current version when it is full synced.

If one of them has status: FAILED or it is not synced, a notification message will be sent to the defined Slack channel (using an Slack incoming webhook).

Slack alert example:

example

How to use

  • Install project requirements: pip install -r requirements.txt
  • Define subgraphs to monitor in config.py file.
  • Execute it: python main.py

Another tool

  • Graphql schema generator. This project uses a graphql endpoint to monitor subgraphs (https://api.thegraph.com/index-node/graphql). If this endpoint schema changes, the command python tools/graphql_schema_generator.py has to be executed to update the schema definition that this project uses.

Check manually a Subgraph status

  • CURRENT subgraph version. Send a HTTP request to https://api.thegraph.com/index-node/graphql using this query:

    indexingStatusForCurrentVersion(subgraphName: "[SUBGRAPH_NAME]") {
      synced
      health
      fatalError {
        message
        block {
          number
          hash
        }
        handler
      }
      chains {
        chainHeadBlock {
          number
        }
        latestBlock {
          number
        }
      }
    }
    
  • PENDING subgraph version. Send a HTTP request to https://api.thegraph.com/index-node/graphql using this query:

    indexingStatusForPendingVersion(subgraphName: "[SUBGRAPH_NAME]") {
      synced
      health
      fatalError {
        message
        block {
          number
          hash
        }
        handler
      }
      chains {
        chainHeadBlock {
          number
        }
        latestBlock {
          number
        }
      }
    }
    

thegraph-subgraphs-monitor's People

Contributors

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