This is an asynchronous RPC health checker built on top of the aiohttp
library in Python. It periodically checks the health status of an RPC server and saves it to a local file. It also provides an HTTP endpoint /health
that returns the health status of the server based on the RPC health checks.
To install the required dependencies, run:
You can also use the pre-built Docker image darkobas/rpchealth
. To start the health checker server using Docker, run:
Copy Docker command
docker run -p 9999:9999 darkobas/rpchealth
This will start the server on http://0.0.0.0:9999
.
Helm charts are also available in the helm
directory of this repository. To use the Helm charts, run:
Copy Helm command
helm install rpchealth ./helm/rpchealth
This will install the rpchealth
chart with the name rpchealth
.
To start the health checker server, run:
This will start the server on http://0.0.0.0:9999
.
The server provides a single endpoint:
This endpoint checks the health status of the RPC server and returns the result.
X-Backend-Server
: the IP address of the RPC server. Defaults to127.0.0.1
.X-Backend-Port
: the port number of the RPC server. Defaults to8545
.
UP
: The server is healthy.DOWN
: The server is not healthy.
The configuration options for the health checker are set through the following constants:
SERVER_DATA_FILE
: The path to the file where the server data is saved. Default isserver_data.json
.HEALTH_CHECK_INTERVAL
: The interval (in seconds) between health checks. Default is60
.TELEGRAM_API_KEY
: Load the Telegram API key for notificationsTELEGRAM_CHAT_ID
** there will be errors if no telegram notifications are configure **TODO fix
This project is licensed under the MIT License. See the LICENSE file for more information.