getblock - Zcash 4.5.1-1 RPC
getblock "hash|height" ( verbosity ) If verbosity is 0, returns a string that is serialized, hex-encoded data for the block. If verbosity is 1, returns an Object with information about the block. If verbosity is 2, returns an Object with information about the block and information about each transaction. Arguments: 1. "hash|height" (string, required) The block hash or height. Height can be negative where -1 is the last known valid block 2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data Result (for verbosity = 0): "data" (string) A string that is serialized, hex-encoded data for the block. Result (for verbosity = 1): { "hash" : "hash", (string) the block hash (same as provided hash) "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain "size" : n, (numeric) The block size "height" : n, (numeric) The block height or index (same as provided height) "version" : n, (numeric) The block version "merkleroot" : "xxxx", (string) The merkle root "finalsaplingroot" : "xxxx", (string) The root of the Sapling commitment tree after applying this block "finalorchardroot" : "xxxx", (string) The root of the Orchard commitment tree after applying this block. Omitted for blocks prior to NU5 activation. This will be the null hash if this block has never been connected to a main chain. "tx" : [ (array of string) The transaction ids "transactionid" (string) The transaction id ,... ], "time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT) "nonce" : n, (numeric) The nonce "bits" : "1d00ffff", (string) The bits "difficulty" : x.xxx, (numeric) The difficulty "previousblockhash" : "hash", (string) The hash of the previous block "nextblockhash" : "hash" (string) The hash of the next block } Result (for verbosity = 2): { ..., Same output as verbosity = 1. "tx" : [ (array of Objects) The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 "tx" result. ,... ], ,... Same output as verbosity = 1. } Examples: > zcash-cli getblock "00000000febc373a1da2bd9f887b105ad79ddc26ac26c2b28652d64e5207c5b5" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["00000000febc373a1da2bd9f887b105ad79ddc26ac26c2b28652d64e5207c5b5"] }' -H 'content-type: text/plain;' http://127.0.0.1:8232/ > zcash-cli getblock 12800 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": [12800] }' -H 'content-type: text/plain;' http://127.0.0.1:8232/
Maintained by @_garethtdavies; modified by: mdr0id;license of the docs is MIT (see zcash repo), license of the scripts and webpage is also MIT (github repo)
Note it uses a mainnet zcash node
Blockchain
Generating
Mining
Network
Rawtransactions
Wallet
addmultisigaddress
backupwallet
dumpprivkey
dumpwallet
encryptwallet
getbalance
getnewaddress
getrawchangeaddress
getreceivedbyaddress
gettransaction
getunconfirmedbalance
getwalletinfo
importaddress
importprivkey
importpubkey
importwallet
keypoolrefill
listaddresses
listaddressgroupings
listlockunspent
listreceivedbyaddress
listsinceblock
listtransactions
listunspent
lockunspent
sendmany
sendtoaddress
settxfee
signmessage
z_exportkey
z_exportviewingkey
z_exportwallet
z_getbalance
z_getmigrationstatus
z_getnewaddress
z_getnotescount
z_getoperationresult
z_getoperationstatus
z_gettotalbalance
z_importkey
z_importviewingkey
z_importwallet
z_listaddresses
z_listoperationids
z_listreceivedbyaddress
z_listunspent
z_mergetoaddress
z_sendmany
z_setmigration
z_shieldcoinbase
z_viewtransaction
zcbenchmark
zcrawjoinsplit
zcrawkeygen
zcrawreceive
zcsamplejoinsplit
backupwallet
dumpprivkey
dumpwallet
encryptwallet
getbalance
getnewaddress
getrawchangeaddress
getreceivedbyaddress
gettransaction
getunconfirmedbalance
getwalletinfo
importaddress
importprivkey
importpubkey
importwallet
keypoolrefill
listaddresses
listaddressgroupings
listlockunspent
listreceivedbyaddress
listsinceblock
listtransactions
listunspent
lockunspent
sendmany
sendtoaddress
settxfee
signmessage
z_exportkey
z_exportviewingkey
z_exportwallet
z_getbalance
z_getmigrationstatus
z_getnewaddress
z_getnotescount
z_getoperationresult
z_getoperationstatus
z_gettotalbalance
z_importkey
z_importviewingkey
z_importwallet
z_listaddresses
z_listoperationids
z_listreceivedbyaddress
z_listunspent
z_mergetoaddress
z_sendmany
z_setmigration
z_shieldcoinbase
z_viewtransaction
zcbenchmark
zcrawjoinsplit
zcrawkeygen
zcrawreceive
zcsamplejoinsplit