Added getblockhash call

This commit is contained in:
g-homebase
2019-09-03 17:31:34 -04:00
committed by kexkey
parent aa7ee15d3d
commit 8c7f2724ff
5 changed files with 65 additions and 0 deletions

View File

@@ -84,3 +84,10 @@ get_mempool_info() {
send_to_watcher_node "${data}" | jq ".result"
return $?
}
get_blockhash() {
trace "Entering get_blockhash()..."
local blockheight=${1}
local data="{\"method\":\"getblockhash\",\"params\":[${blockheight}]}"
send_to_watcher_node "${data}" | jq ".result"
return $?
}

View File

@@ -182,6 +182,13 @@ main() {
response_to_client "${response}" ${?}
break
;;
getblockhash)
# curl (GET) http://192.168.111.152:8080/getblockhash/522322
response=$(get_blockhash $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f3))
response_to_client "${response}" ${?}
break
;;
getblockinfo)
# curl (GET) http://192.168.111.152:8080/getblockinfo/000000006f82a384c208ecfa04d05beea02d420f3f398ddda5c7f900de5718ea