根据区块哈哈希获取区块信息
参数
序号 | 数据类型 | 描述 |
---|---|---|
1 | DATA, 32 Bytes | 区块哈希 |
2 | Boolean | true - 返回完整的交易对象 false - 只返回交易的哈希值 |
返回值
object - 区块对象,如果没找到区块则返回null。区块内容包括:
名称 | 数据类型 | 描述 |
---|---|---|
number | QUANTITY | 区块号 |
hash | DATA, 32 Bytes | 区块哈希值 |
parentHash | DATA, 32 Bytes | 父区块哈希值 |
nonce | QUANTITY | 未使用的字段 |
sha3Uncles | DATA, 32 Bytes | 叔块哈希 |
logsBloom | DATA, 256 Bytes | 块的日志布隆过滤器 |
transactionsRoot | DATA, 32 Bytes | 区块的交易树的根 |
stateRoot | DATA, 32 Bytes | 区块的状态树的根 |
receiptsRoot | DATA, 32 Bytes | 区块的收据树的根 |
miner | DATA, 20 Bytes | 生产该区块的超级代表的地址 |
difficulty | QUANTITY | 生产该区块的难度系数 |
totalDifficulty | QUANTITY | 区块链直到该区块的总难度系数 |
extraData | DATA | 额外数据 |
size | QUANTITY | 区块大小,以字节为单位 |
gasLimit | QUANTITY | 费用限制 |
gasUsed | QUANTITY | 区块中所有交易所消耗的总费用 |
timestamp | QUANTITY | 创建块时的Unix时间戳,单位为秒 |
transactions | Array | 区块中的所有交易 |
uncles | Array | 叔块哈希数组 |
示例
curl -X POST 'https://api.shasta.trongrid.io/jsonrpc' --data '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": ["0x0000000000f9cc56243898cbe88685678855e07f51c5af91322c225ce3693868", false],
"id": 1
}'
结果
{"jsonrpc":"2.0","id":1,"result":null}