GetBlock

Query block header information or entire block information according to block height or block hash. (Confirmed state).

This method will use 30 Compute Units.


Parameters

  • id_or_num - String - Can be the block height or the block hash. No value entered means to query the latest block

  • detail - Boolean - true means query the entire block information including the header and body. false means only query the block header information.

Returns

Field
Type
Description

blockID

string

block hash

block_header.raw_data.timestamp

int64

block timestamp

block_header.raw_data.txTrieRoot

string

the root of transaction merkle tree

block_header.raw_data.parentHash

string

parent block hash

block_header.raw_data.number

int64

block number

block_header.raw_data.witness_id

int64

super representative id

block_header.raw_data.witness_address

string

super representative address

block_header.raw_data.version

int32

version

block_header.raw_data.accountStateRoot

string

the root of account state tree

block_header.witness_signature

string

the signature of SR

transactions

Transaction[]

Transaction information in the block, please refer to gettransactionbyid for the content contained in each transaction

// Result
{
	"blockID": "00000000048706778e73e1c6697e6cbe04efd0216758f7880f59e99fb5203898",
	"block_header": {
		"raw_data": {
			"number": 75957879,
			"txTrieRoot": "b5f9d8ac91acdf50a8ef6c653ea3938d1be22220148cc93f8642d0ad724d1083",
			"witness_address": "41a1a508ce5762ffd3f16bd6af93808d26d57f01eb",
			"parentHash": "00000000048706763ce15ad93be71d737e2ef08d6903de909aa18cadcc7f0c3d",
			"version": 32,
			"timestamp": 1758533718000
		},
		"witness_signature": "bdb19108257bcca8e633d890023e3a6ca845f5c5e433df6ce37aa07cea71778b6b359b8dd2df7e51774023dfb2b4bf425d6a3a11750ba50cbaf40c702c52b19100"
	}
}
curl https://mainnet.tron.validationcloud.io/v1/<YOUR_API_KEY_HERE>/walletsolidity/getblock \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"detail":false}'

Last updated

Was this helpful?