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
2021-12-30 18:49:25 +01:00
.github/workflows Add .github/workflows/release.yml 2021-12-30 18:05:15 +01:00
scripts Rename generated package info file from scrtips/info to scripts/pkg_info 2021-12-30 18:49:25 +01:00
src Merge branch 'freebsd-newsyslog-signal-on-rotate' 2021-12-24 11:09:17 +01:00
.gitignore Initial commit 2020-02-03 13:24:34 +01:00
compile.sh compile.sh: move package stuff to package.sh 2021-12-02 12:54:42 +01:00
go.mod Convert to go module 2021-12-23 16:47:15 +01:00
go.sum Convert to go module 2021-12-23 16:47:15 +01:00
Makefile Rename generated package info file from scrtips/info to scripts/pkg_info 2021-12-30 18:49:25 +01:00
package.sh compile.sh: move package stuff to package.sh 2021-12-02 12:54:42 +01:00
README.md README.md: Add more documentation for compiling and packaging 2021-12-02 12:56:57 +01:00
set-version.sh Adding set-version.sh 2021-12-02 13:23:03 +01:00

EOSIO API Healthcheck for HAProxy

This program implements EOSIO healthcheck for HAProxy over TCP.

Compiling

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

First you need to install golang dependacies:

$ make deps

Then you can 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 url Yes (port default 80) http url to the api. http(s)://<ip-or-domain>(:<port>)
2 num_blocks No (default 10) Number of blocks the api can drift before reported down
3 version No (default v1) API Version to check against, v1 = standard, v2 = Hyperion
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
failed 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