Block Info
Query and analyze TRON blocks — latest block data, block rewards, producer info, TRX burns, resource consumption, transaction breakdown, and network load trends.
MCP Server
Instructions
Step 1: Fetch Block Data
Choose the right tool based on the query:
| Query Type | Tool | Parameters |
|---|
| Latest block | INLINECODE0 | none (omit id_or_num) |
| Latest confirmed block |
solidityGetBlock | none (omit
id_or_num) |
| Block by number |
getBlock |
id_or_num=<height>,
detail=false |
| Block range | loop
getBlock |
id_or_num=<height> incrementing,
detail=false |
| Latest N blocks | loop
getBlock N times | start from latest, decrement
id_or_num |
| Block statistics |
getBlockStatistics |
blockNum |
Step 2: Parse Block Header
Extract from the block response:
- - Block Number (height), Block Hash, Timestamp
- Parent Hash (link to previous block)
- Witness Address (producer SR)
- Version number
Step 3: Identify Block Producer
- 1. Extract witness address from block header
- Call
getPaginatedNowWitnessList to match address to SR name/URL - Call
getBrokerage for the producing SR to get reward distribution ratio
Step 4: Analyze Block Transactions
- 1. Count and categorize transactions from block data: TRX transfers, TRC-10 transfers, smart contract calls, contract deployments, staking, voting, other
- Call
getTransactionInfoByBlockNum for receipts — reveals total fees, energy consumed, bandwidth consumed, success/failure counts
Step 5: Calculate Rewards & Burns
From transaction receipts:
- - Block Reward: 16 TRX per block (current parameter)
- TRX Burned: Sum of energy/bandwidth/account creation fees burned
- SR Revenue: Block reward + allocated transaction fees
Step 6: Assess Network Load
Compare block metrics against capacity:
- - Transaction density vs. block capacity
- Energy/bandwidth utilization rates
- For trends, loop
getBlock 10–20 times (decrementing id_or_num) and compare
Step 7: Check Block Events
Call getEventsByBlockNumber for smart contract events (DeFi swaps, token transfers, governance actions).
Step 8: Compile Block Report
CODEBLOCK0
For multi-block trend queries:
CODEBLOCK1
Error Handling
| Error | Cause | Resolution |
|---|
| Block not found | Future block number or invalid hash | Check current height with getBlock (no params) first |
| Empty block |
Block with zero transactions | Report as empty block — this is normal for low-activity periods |
| Range too large | Looping
getBlock for many blocks | Split into smaller batches; avoid requesting more than 100 blocks in a single flow |
| No events | Block has no smart contract activity | Skip events section, note "No contract events in this block" |
Examples
区块信息
查询和分析TRON区块——最新区块数据、区块奖励、生产者信息、TRX销毁、资源消耗、交易明细及网络负载趋势。
MCP服务器
操作说明
步骤1:获取区块数据
根据查询类型选择合适的工具:
| 查询类型 | 工具 | 参数 |
|---|
| 最新区块 | getBlock | 无(省略idornum) |
| 最新已确认区块 |
solidityGetBlock | 无(省略id
ornum) |
| 按编号查询区块 | getBlock | id
ornum=<高度>,detail=false |
| 区块范围 | 循环调用getBlock | id
ornum=<高度>递增,detail=false |
| 最新N个区块 | 循环调用getBlock N次 | 从最新开始,递减id
ornum |
| 区块统计 | getBlockStatistics | blockNum |
步骤2:解析区块头
从区块响应中提取:
- - 区块编号(高度)、区块哈希、时间戳
- 父哈希(链接到上一个区块)
- 见证人地址(生产者超级代表)
- 版本号
步骤3:识别区块生产者
- 1. 从区块头中提取见证人地址
- 调用getPaginatedNowWitnessList将地址匹配到超级代表名称/URL
- 调用getBrokerage获取生产超级代表的奖励分配比例
步骤4:分析区块交易
- 1. 统计并分类区块数据中的交易:TRX转账、TRC-10转账、智能合约调用、合约部署、质押、投票、其他
- 调用getTransactionInfoByBlockNum获取收据——显示总费用、消耗的能量、消耗的带宽、成功/失败计数
步骤5:计算奖励与销毁
从交易收据中:
- - 区块奖励:每个区块16 TRX(当前参数)
- 已销毁TRX:消耗的能量/带宽/账户创建费用总和
- 超级代表收入:区块奖励 + 分配的交易费用
步骤6:评估网络负载
将区块指标与容量进行比较:
- - 交易密度 vs. 区块容量
- 能量/带宽利用率
- 趋势分析:循环调用getBlock 10–20次(递减idornum)并进行比较
步骤7:检查区块事件
调用getEventsByBlockNumber获取智能合约事件(DeFi交换、代币转账、治理操作)。
步骤8:编制区块报告
区块 #[编号]
概览
- - 哈希:[哈希]
- 时间:[时间戳]
- 生产者:[超级代表名称]([地址])
- 佣金比例:[X%]
交易
XX | XX% |
| 质押 | XX | XX% |
经济数据
- - 区块奖励:[X] TRX
- 费用:[X] TRX | 销毁:[X] TRX
资源
- - 能量消耗:[数量]
- 带宽消耗:[数量]
- 网络负载:[低/中/高]
多区块趋势查询:
网络状态(最近[N]个区块)
- - 平均交易数/区块:[数量]
- 平均出块时间:[X.X]秒
- TRX总销毁量:[数量]
- 当前高度:#[编号]
- 负载趋势:[上升中/稳定/下降中]
错误处理
| 错误 | 原因 | 解决方法 |
|---|
| 未找到区块 | 未来区块编号或无效哈希 | 先使用getBlock(无参数)检查当前高度 |
| 空区块 |
零交易的区块 | 报告为空区块——低活跃期属于正常现象 |
| 范围过大 | 循环调用getBlock获取过多区块 | 拆分为更小的批次;单次流程中避免请求超过100个区块 |
| 无事件 | 区块无智能合约活动 | 跳过事件部分,注明此区块无合约事件 |
示例