From 2d126c473bf8cbe2f064e537bcbd941064212156 Mon Sep 17 00:00:00 2001 From: kexkey Date: Tue, 6 Aug 2019 19:05:49 -0400 Subject: [PATCH] New helloworld endpoint useful when diagnosing --- api_auth_docker/api-sample.properties | 1 + cyphernodeconf_docker/templates/gatekeeper/api.properties | 1 + cyphernodeconf_docker/templates/installer/testfeatures.sh | 2 +- proxy_docker/app/script/requesthandler.sh | 7 ++++++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api_auth_docker/api-sample.properties b/api_auth_docker/api-sample.properties index 9e62024..65529c0 100644 --- a/api_auth_docker/api-sample.properties +++ b/api_auth_docker/api-sample.properties @@ -1,6 +1,7 @@ # The file api.properties generated by the installer should look like this. # Stats can: +action_helloworld=stats action_getblockchaininfo=stats action_installation_info=stats action_getmempoolinfo=stats diff --git a/cyphernodeconf_docker/templates/gatekeeper/api.properties b/cyphernodeconf_docker/templates/gatekeeper/api.properties index a0c82b0..99d32e0 100644 --- a/cyphernodeconf_docker/templates/gatekeeper/api.properties +++ b/cyphernodeconf_docker/templates/gatekeeper/api.properties @@ -4,6 +4,7 @@ # Admin can do what the spender can do plus even more stuff # Stats can: +action_helloworld=stats action_getblockchaininfo=stats action_installation_info=stats action_getmempoolinfo=stats diff --git a/cyphernodeconf_docker/templates/installer/testfeatures.sh b/cyphernodeconf_docker/templates/installer/testfeatures.sh index c9e75a9..5f8fd1c 100644 --- a/cyphernodeconf_docker/templates/installer/testfeatures.sh +++ b/cyphernodeconf_docker/templates/installer/testfeatures.sh @@ -100,7 +100,7 @@ checknotifier() { local response local returncode - response=$(mosquitto_rr -h broker -W 15 -t notifier -e "response/$$" -m "{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"http://proxy:8888/getbestblockhash\"}") + response=$(mosquitto_rr -h broker -W 15 -t notifier -e "response/$$" -m "{\"response-topic\":\"response/$$\",\"cmd\":\"web\",\"url\":\"http://proxy:8888/helloworld\"}") returncode=$? [ "${returncode}" -ne "0" ] && return 115 http_code=$(echo "${response}" | jq ".http_code" | tr -d '"') diff --git a/proxy_docker/app/script/requesthandler.sh b/proxy_docker/app/script/requesthandler.sh index 10ed656..00cc4cd 100644 --- a/proxy_docker/app/script/requesthandler.sh +++ b/proxy_docker/app/script/requesthandler.sh @@ -72,6 +72,11 @@ main() trace "[main] line=${line}" fi case "${cmd}" in + helloworld) + # GET http://192.168.111.152:8080/helloworld + response_to_client "Hello, world!" 0 + break + ;; installation_info) # GET http://192.168.111.152:8080/info if [ -f "$DB_PATH/info.json" ]; then @@ -286,7 +291,7 @@ main() ;; getmempoolinfo) # curl GET http://192.168.111.152:8080/getmempoolinfo - + response=$(get_mempool_info) response_to_client "${response}" ${?} break