mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-18 21:25:06 +01:00
Added getblockchaininfo endpoint
This commit is contained in:
@@ -67,3 +67,12 @@ get_transaction()
|
||||
send_to_watcher_node "${data}"
|
||||
return $?
|
||||
}
|
||||
|
||||
get_blockchain_info()
|
||||
{
|
||||
trace "Entering get_blockchain_info()..."
|
||||
|
||||
local data='{"method":"getblockchaininfo"}'
|
||||
send_to_watcher_node "${data}" | jq ".result"
|
||||
return $?
|
||||
}
|
||||
@@ -302,6 +302,11 @@ main()
|
||||
serve_ots_getfile $(echo "${line}" | cut -d ' ' -f2 | cut -d '/' -f3)
|
||||
break
|
||||
;;
|
||||
getblockchaininfo)
|
||||
# http://192.168.111.152:8080/getblockchaininfo
|
||||
|
||||
response=$(get_blockchain_info)
|
||||
response_to_client "${response}" ${?}
|
||||
esac
|
||||
break
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user