Stateless metrics and health-checks for openethereum/parity nodes
Go to file
Mohamed Sohail 8d7acc0f84
docs: update info
2021-12-15 14:59:09 +03:00
cmd/node-status release: v0.0.1 2021-12-15 14:54:27 +03:00
config release: v0.0.1 2021-12-15 14:54:27 +03:00
internal/server metrics: add pending tx and peer count 2021-12-15 12:57:47 +03:00
pkg add: hex2uint64 util 2021-12-14 18:41:24 +03:00
.dockerignore release: v0.0.1 2021-12-15 14:54:27 +03:00
.gitignore release: v0.0.1 2021-12-15 14:54:27 +03:00
Dockerfile release: v0.0.1 2021-12-15 14:54:27 +03:00
LICENSE docs: add license 2021-12-14 18:47:05 +03:00
Makefile release: v0.0.1 2021-12-15 14:54:27 +03:00
README.md docs: update info 2021-12-15 14:59:09 +03:00
go.mod project: update go pkg path 2021-12-14 18:52:59 +03:00
go.sum project: init 2021-12-14 14:24:18 +03:00

README.md

openethereum-node-status

A tiny stateless service to return health status and useful metrics from OpenEthereum/Parity nodes using batched RPC queries. Requires the following API's to be enabled:

  • eth
  • parity

Usage

Default config:

RPC_ENDPOINT=https://core.bloxberg.org
SERVER_PORT=80
DEBUG_ENABLED=false

Build and run:

make build
docker build -t node-status:latest .
docker run --rm -p 5555:80 node-status:latest

Pre-build Docker image is available at docker.grassecon.net/devops/node-status:latest

Use with any uptime tracker and/or metrics scrapper.

Endpoints

  • /health:
{
  "chainName": "bloxberg",
  "syncComplete": true
}
  • /metrics:
{
  "blockNumber": 13421262,
  "enode": "enode://0fb17be7e259fee00d0c123c82dfd9cde74763683b7773a1d764a472436362c3031eac591721c02f754ba22140bb654f69261a7dc79143419a3ff8aff1298cce@130.183.206.234:30303",
  "gasPrice": 0,
  "peerCount": 5,
  "pendingTransactions": [
    {
      "hash": "0x04b39537eaed56bdab1309d6f2dd6a2618f1725db3709d345a15cc967bb4481f",
      "from": "0xfc6771c7bd523403327d8fe84b63c3262c2007d6",
      "to": "0x105e668e389620d5588847c35fb91ea096f465ca"
    }
  ],
  "pendingTransactionsCount": 1
}

In-case of any issues, the endpoints return a 503 error

Development

DEBUG_ENABLED=true go run cmd/node-status/main.go