getblock - Pastel 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 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 "pastelid" : "xxxx", (string) The Pastel ID (mnid) of the block signer (for v5 block version only) "prevMerkleRootSignature" : "xxxx", (string) The signature of the previous block's merkle root (for v5 block version only) "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: > pastel-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:9932/ > pastel-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:9932/
Maintained by Pastel Network; license of the docs is MIT (see pastel repo)
Generated from a mainnet node
Addressindex
Blockchain
Control
Generating
Mining
Mnode
Network
Rawtransactions
Wallet
addmultisigaddress
backupwallet
dumpprivkey
dumpwallet
encryptwallet
fixmissingtxs
getaccount
getaccountaddress
getaddressesbyaccount
getbalance
getnewaddress
getrawchangeaddress
getreceivedbyaccount
getreceivedbyaddress
gettransaction
gettxfee
getunconfirmedbalance
getwalletinfo
importaddress
importprivkey
importwallet
keypoolrefill
listaccounts
listaddressamounts
listaddressgroupings
listlockunspent
listreceivedbyaccount
listreceivedbyaddress
listsinceblock
listtransactions
listunspent
lockunspent
move
scanburntransactions
scanformissingtxs
sendfrom
sendmany
sendtoaddress
setaccount
settxfee
signmessage
z_exportkey
z_exportviewingkey
z_exportwallet
z_getbalance
z_getnewaddress(type)
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_sendmanywithchangetosender
z_shieldcoinbase
z_viewtransaction
zcbenchmark