Git Product home page Git Product logo

rpc-fetching-blocks-healthcheck's Introduction

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

Deprecated in favour of https://github.com/osmosis-labs/osmosis-rpc-healthcheck

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

rpc-fetching-blocks-healthcheck

Simple controller written in python that serves an healthcheck to determine if an rpc node is synced and fetching blocks.

Run

Locally

Run locally:

pip install -r requirements.txt
make start

usage

Docker

Build the image:

make build

Specify the rpc node to check:

export RPC_NODE=https://rpc-osmosis.blockapsis.com/

Run:

docker run \
    -p 8080:8080 \
    -e RPC_NODE=$(RPC_NODE) \
    -e CHECK_INTERVAL=10 \
    -e NEW_BLOCK_THRESHOLD=30 \
    --name sync-controller \
    sync-controller:$(TAG) 

Usage

The controller exposes a simple REST Endpoint that:

  • Responds with a 200 status code if the rpc is fetching blocks
  • Responds with a 503 status code if the rpc is not fetching blocks

Example:

curl -X GET --head http://0.0.0.0:8080 
HTTP/1.1 200 OK

Alarms

The healthcheck can be configured to send alarms via slack webhooks:

export SLACK_WEBHOOK="https://hooks.slack.com/services/T..."

rpc-fetching-blocks-healthcheck's People

Stargazers

 avatar

Watchers

 avatar

rpc-fetching-blocks-healthcheck's Issues

Fix Epoch Detection

Currently nodes return 503 during epoch.

We need to setup a way to approximate epoch start time.

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.