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.)
## 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file graphene-healthchecker-0.1.2.tar.gz
.
File metadata
- Download URL: graphene-healthchecker-0.1.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f88a72a6203de951f7c23c384c5a72a840392e4b9a6c3fb67f9cac49b5f55646 |
|
MD5 | df3a94f2ebb1c87f4f404a949ab571e1 |
|
BLAKE2b-256 | f4e368df83d76f7e0b97e62caf32fb884ba14952d53e1c22c2952e2690549b16 |
File details
Details for the file graphene_healthchecker-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: graphene_healthchecker-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2474c98c48e8f4240d458d290beef1e5a070ebfd9abeea70b601120f76874b0 |
|
MD5 | 89fa1b37d83b89b402b1fd3ee2371458 |
|
BLAKE2b-256 | e0b004ff04e4521a408e226d5a0231ac40c039a9f9f896cb8851bbeb09e57dc0 |