1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-16 04:44:55 +02:00
No description
Find a file
2022-11-23 17:04:54 +01:00
.github/workflows .github/workflows/test.yml: rename to test. 2022-10-13 13:04:54 +02:00
cmd/eosio-api-healtcheck move internal/*.go files into internal/server 2022-11-23 16:54:22 +01:00
debian Version 1.2.5 2022-10-21 13:43:09 +02:00
internal rename EosioContract to AtomicAsset. 2022-11-23 17:04:54 +01:00
scripts scripts/templates/config: Add "--log-format=logfmt" to default options. 2022-10-21 12:43:37 +02:00
.gitignore .gitignore: ignore .vscode directory 2022-10-26 14:27:17 +02:00
compile.sh Convert hard tabs to soft. 2022-03-02 15:56:29 +01:00
go.mod Change github.com/eosswedenorg-go/eos-contract-api-client to github.com/eosswedenorg-go/atomicasset 2022-11-23 16:04:23 +01:00
go.sum Change github.com/eosswedenorg-go/eos-contract-api-client to github.com/eosswedenorg-go/atomicasset 2022-11-23 16:04:23 +01:00
LICENSE Adding LICENSE 2022-01-01 14:46:38 +01:00
Makefile Refactor: move internal package from src/ to internal/ and move src/main.go to cmd/eosio-api-healthcheck/main.go 2022-10-27 12:58:30 +02:00
README.md README.md: Update documentation to golang v1.16 as the minimum version. 2022-10-13 13:31:13 +02:00
set-version.sh set-version.sh: handle spaces for Makefile variable. 2022-08-22 15:43:13 +02:00

EOSIO API Healthcheck for HAProxy

This program implements EOSIO healthcheck for HAProxy over TCP.

Compiling

You will need go-lang version 1.16 or later to compile the source.

compile with compile.sh script

$ ./compile.sh

Execute ./compile.sh --help to see all available flags to crosscompile for different systems/architectures.

Package

run ./package.sh to generate package. Debian (.deb) and FreeBSD are supported.

TCP Protocol

The protocol is simple and has 4 rules.

  1. Data is transmitted in packets encoded in ascii and ends with newline \n.
  2. There are two types of packages: Request and Response. Each Request has exactly one Response.
  3. Each parameter inside a Request is separated by |
  4. Each response contains exactly one status code (see below)

Request

The following parameters are supported in a request and are ordered from first to last below:

# Name Required Description
1 api Yes Type of API to check against, v1 = standard, v2 = Hyperion, contract = eosio-contract-api
2 url Yes (port default 80) http url to the api. http(s)://<ip-or-domain>(:<port>)
3 num_blocks No (default 10) Number of blocks the api can drift before reported down
4 host No (default from url) Value to send in the HTTP Host Header to the API

Response

The api can respond with exactly one status code. See HAproxy documentation for more information

code Description
up Api is healthy
down Api is not healthy
fail The program failed to read the status from the api.
maint Api is set in maintenance mode (not used)
ready Api is ready again after being in maint state (not used)
stopped Api has been stopped manually (not used)

Author

Henrik Hautakoski - henrik@eossweden.org