mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-02-20 19:44:27 +01:00
New helloworld endpoint useful when diagnosing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 '"')
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user