Skip to main content

Python library for RPC-healthchecking for graphene blockchains

Project description

# Graphene Backend Healthchecking

## Installation

pip3 install graphene-healthchecker

## Running Health Check

```
Usage: graphenehealth [OPTIONS] URL

Options:
--listen INTEGER
--help Show this message and exit.
```

**Example**:

```
graphenehealth --listen 8080 https://__ENDPOINT__
```

## Deploy with UWSGI

To deploy with UWSGI, please copy the `config-defaults.yml` file
into your working directory and deploy with systemd.

In `backend-health.service`, replace the variables in `{{ ... }}`
and install it in your systemd directory `/etc/systemd/system`.

## Health Check

1. Check if a connection can be established to the backend node.
(Raise HTTP/402 if not.)
2. Check that the returned answer from the backend has status code 200.
(Raise HTTP/402 if not.)
3. Check if the answer has a "result" key in its json representation.
(Raise HTTP/402 if not.)
4. Obtain the time of the most recent block as well as the next
maintenance time
5. Check that current head time is less than 60 seconds old and next
maintenance interval is more than 10 seconds in the future.
(Raise HTTP/402 if not.)


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphene-healthchecker-0.1.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

graphene_healthchecker-0.1.1-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page