openethereum-node-status/README.md

65 lines
1.4 KiB
Markdown

## 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](https://openethereum.github.io/JSONRPC) to be enabled:
- eth
- parity
#### Usage
Default config:
```bash
RPC_ENDPOINT=https://core.bloxberg.org
SERVER_PORT=80
DEBUG_ENABLED=false
```
Build and run:
```bash
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`:
```json
{
"chainName": "bloxberg",
"syncComplete": true
}
```
- `/metrics`:
```json
{
"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`