https://github.com/edenlabllc/ethereum-health-check
Ethereum node health check microservice
https://github.com/edenlabllc/ethereum-health-check
docker ethereum go-micro healthcheck microservice
Last synced: 22 days ago
JSON representation
Ethereum node health check microservice
- Host: GitHub
- URL: https://github.com/edenlabllc/ethereum-health-check
- Owner: edenlabllc
- License: mit
- Created: 2018-10-26T07:55:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-23T11:10:47.000Z (over 6 years ago)
- Last Synced: 2025-02-12T08:45:13.336Z (2 months ago)
- Topics: docker, ethereum, go-micro, healthcheck, microservice
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ethereum Node Health Check Microservice
Microservice that checks ethereum node health, by comparing node block number with block number from [etherscan](https://etherscan.io)
```
$ curl -H 'Content-Type: application/json' http://0.0.0.0:8080/ethealth/check
{"health":true}$ curl -H 'Content-Type: application/json' http://0.0.0.0:8080/ethealth/check
{"health":false, diff: 10}
```## Install
```
go get github.com/micro/go-micro
```
## Required ENV variables|Name |Type |Description |
|--- |--- |--- |
|NODE_ADDR |URL | URL for node to connect, with schema |
|MAXBLOCKDIFFERENCE |int | Number of blocks difference between healthchecked node and etherscan api that count unhealthy |
|ETHERSCAN_PREFIX |string | Testnet name |
|ETHERSCAN_API_KEY |string | Etherscan api key. https://etherscan.io/apis |## Usage
```
MICRO_REGISTRY=mdns micro api --handler=rpc
MICRO_REGISTRY=mdns NODE_ADDR= MAXBLOCKDIFFERENCE=3 ETHERSCAN_PREFIX=rinkeby ETHERSCAN_API_KEY= go run main.gocurl -H 'Content-Type: application/json' http://localhost:8080/ethealth/check
```## Deploy
Setup proper ENV variables
```
docker-compose up -d
```## Contributing
PRs accepted.
## License
MIT © Edenlabllc http://edenlab.com.ua