mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-01-07 15:05:41 +01:00
Added getblockhash call
This commit is contained in:
@@ -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 $?
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user