block_getBatchBlocksByHash
根据区块哈希列表批量查询区块详细信息。
Parameters
<Object>
hashes
:[<string>]
- 要查询的区块哈希数组,哈希值为32字节的十六进制字符串。isPlain
:<boolean>
- 值为true
,表示返回的区块不包括区块内的交易。值为false
表示返回的区块包括区块内的交易信息。
Returns
[<Block>]
- Block对象数组,Block对象字段见 Block.
Example1:返回的区块包含交易信息
- # Request
- curl -X POST --data ' {"jsonrpc":"2.0","method":"block_getBatchBlocksByHash","params":[{
- "hashes":["0x810c92919fba632471b543905d8b4f8567c4fac27e5929d2eca8558c68cb7cf0","0x9c41efcc50ec6af6e3d14e1669f37bd1fc0cfe5836af6ab1e43ced98653c938b"]
- }],"id":1}'
- # Response
- {
- "jsonrpc": "2.0",
- "namespace": "global",
- "id": 1,
- "code": 0,
- "message": "SUCCESS",
- "result": [
- {
- "version": "1.3",
- "number": "0x3",
- "hash": "0x810c92919fba632471b543905d8b4f8567c4fac27e5929d2eca8558c68cb7cf0",
- "parentHash": "0x9c41efcc50ec6af6e3d14e1669f37bd1fc0cfe5836af6ab1e43ced98653c938b",
- "writeTime": 1509448178829111592,
- "avgTime": "0x0",
- "txcounts": "0x0",
- "merkleRoot": "0x97b0d9473478886f5b0aee123d5652b15d4ae3ab41cc487cda9d8885cb003481"
- },
- {
- "version": "1.3",
- "number": "0x2",
- "hash": "0x9c41efcc50ec6af6e3d14e1669f37bd1fc0cfe5836af6ab1e43ced98653c938b",
- "parentHash": "0x4cd9f393aabb2df51c09e66925c4513e23f0dbbb9e94d0351c1c3ec7539144a0",
- "writeTime": 1509440823930976319,
- "avgTime": "0x6",
- "txcounts": "0x1",
- "merkleRoot": "0x97b0d9473478886f5b0aee123d5652b15d4ae3ab41cc487cda9d8885cb003481",
- "transactions": [
- {
- "version": "1.3",
- "hash": "0x22321358931c577ceaa2088d914758148dc6c1b6096a0b3f565d130f03ca75e4",
- "blockNumber": "0x2",
- "blockHash": "0x9c41efcc50ec6af6e3d14e1669f37bd1fc0cfe5836af6ab1e43ced98653c938b",
- "txIndex": "0x0",
- "from": "0x17d806c92fa941b4b7a8ffffc58fa2f297a3bffc",
- "to": "0xaeccd2fd1118334402c5de1cb014a9c192c498df",
- "amount": "0x0",
- "timestamp": 1509440823410000000,
- "nonce": 8291834415403909,
- "extra": "",
- "executeTime": "0x6",
- "payload": "0x0a9ae69d"
- }
- ]
- }
- ]
- }
Example2:返回的区块不包括交易信息
- # Request
- curl -X POST --data ' {"jsonrpc":"2.0","method":"block_getBatchBlocksByHash","params":[{
- "hashes":["0x810c92919fba632471b543905d8b4f8567c4fac27e5929d2eca8558c68cb7cf0","0x9c41efcc50ec6af6e3d14e1669f37bd1fc0cfe5836af6ab1e43ced98653c938b"],
- "isPlain": true
- }],"id":1}'
- # Response
- {
- "jsonrpc": "2.0",
- "namespace": "global",
- "id": 1,
- "code": 0,
- "message": "SUCCESS",
- "result": [
- {
- "version": "1.3",
- "number": "0x3",
- "hash": "0x810c92919fba632471b543905d8b4f8567c4fac27e5929d2eca8558c68cb7cf0",
- "parentHash": "0x9c41efcc50ec6af6e3d14e1669f37bd1fc0cfe5836af6ab1e43ced98653c938b",
- "writeTime": 1509448178829111592,
- "avgTime": "0x0",
- "txcounts": "0x0",
- "merkleRoot": "0x97b0d9473478886f5b0aee123d5652b15d4ae3ab41cc487cda9d8885cb003481"
- },
- {
- "version": "1.3",
- "number": "0x2",
- "hash": "0x9c41efcc50ec6af6e3d14e1669f37bd1fc0cfe5836af6ab1e43ced98653c938b",
- "parentHash": "0x4cd9f393aabb2df51c09e66925c4513e23f0dbbb9e94d0351c1c3ec7539144a0",
- "writeTime": 1509440823930976319,
- "avgTime": "0x6",
- "txcounts": "0x1",
- "merkleRoot": "0x97b0d9473478886f5b0aee123d5652b15d4ae3ab41cc487cda9d8885cb003481"
- }
- ]
- }
当前内容版权归 Hyperchain 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Hyperchain .