release: v0.0.1

This commit is contained in:
Mohamed Sohail 2021-12-15 14:54:27 +03:00
parent c50906ede1
commit b9c5d7458b
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
7 changed files with 76 additions and 6 deletions

6
.dockerignore Normal file
View File

@ -0,0 +1,6 @@
cmd
internal
pkg
.*
go.*
Makefile

3
.gitignore vendored
View File

@ -1 +1,2 @@
vendor/
vendor/
node-status

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM iron/go
WORKDIR /dist
COPY . .
EXPOSE 80
ENTRYPOINT ["/dist/node-status"]

6
Makefile Normal file
View File

@ -0,0 +1,6 @@
GIN := jsoniter
BIN := node-status
.PHONY: build
build:
CGO_ENABLED=0 go build -tags=${GIN} -o ${BIN} cmd/node-status/*.go

View File

@ -1,16 +1,63 @@
### openethereum-node-status
> ⚠️ WIP
A tiny stateless service to return health status and useful metrics from OpenEthereum/Parity nodes. 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_POINT=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` (Expect 200 for health with an additional JSON object with more info)
- `/metrics` (Expect 200 with an additional JSON object with more info)
- `/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

View File

@ -56,6 +56,9 @@ func main() {
}
server.RpcClient = rpc.NewRpcClient(conf.String("rpc.endpoint"))
log.Info().
Str("module", "main").
Msg("starting server")
if err := server.Start(fmt.Sprintf(":%s", conf.String("server.port")), ginMode); err != nil {
log.Fatal().

View File

@ -2,7 +2,7 @@
endpoint = "https://core.bloxberg.org"
[server]
port = "5555"
port = "80"
[debug]
enabled = false