From 2526ad78f82a21fdaab9b9f7575f2f11d26b4939 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 13 Aug 2021 14:33:39 +0200 Subject: [PATCH] Adding README.md --- README.md | 35 +++++++++++++++++++++++++++++++++++ scripts/pkg_deb.sh | 1 + 2 files changed, 36 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5325ab3 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# Etherium Healthcheck for HAProxy + +Etherium healthcheck for HAProxy via Etherium HTTP JSON-RPC API. + +## Compiling + +You will need go-lang version `1.14` or later to compile the source. + +## CLI Options + +When starting the tcp server you can specify what address and port it should listen to: + +`eth-healthcheck ` + +by default it will listen to `127.0.0.1:1301` + +## JSON-RPC API + +The healthcheck server can check any Etherium client that supports the **JSON-RPC API** via **HTTP**. Here is the documentation for the popular [geth client](https://geth.ethereum.org/docs/rpc/server). + +## HAproxy configuration + +You will need to tell haproxy to send a message to the tcp server with the HTTP url to a etherium client's JSON-RPC API that you would like to check. + +This url should be passed to the `agent-send` parameter in HAproxy config like this: + +``` +check agent-check agent-addr 127.0.0.1 agent-port 1301 agent-send "http://127.0.0.1:8545\n" +``` + +Read the [documentation](https://www.haproxy.com/documentation/hapee/latest/load-balancing/health-checking/agent-health-checks) for more information. + +## Author + +Henrik Hautakoski - [henrik@eossweden.org](mailto:henrik@eossweden.org) diff --git a/scripts/pkg_deb.sh b/scripts/pkg_deb.sh index 249bb30..8ab740b 100755 --- a/scripts/pkg_deb.sh +++ b/scripts/pkg_deb.sh @@ -41,6 +41,7 @@ cp ${BUILD_DIR}/${PACKAGE_PROGRAM} ${PACKAGE_TMPDIR}/${PACKAGE_BINDIR}/${PACKAGE # Copy files. mkdir -p ${PACKAGE_TMPDIR}/${PACKAGE_SHAREDIR} +cp ${BASE_DIR}/../README.md ${PACKAGE_TMPDIR}/${PACKAGE_SHAREDIR} cp ${BASE_DIR}/../LICENSE ${PACKAGE_TMPDIR}/${PACKAGE_SHAREDIR} fakeroot dpkg-deb --build ${PACKAGE_TMPDIR} ${BUILD_DIR}/${PACKAGE_FULLNAME}.deb