tx_getBlockTransactionCountByHash

根据区块哈希查询区块交易数量。

Parameters

  1. <string> - 32字节的十六进制字符串,区块的哈希值。

Returns

  1. <string> - 十六进制字符串,交易数量。

Example1:正常的请求

  1. # Request
  2. curl -X POST --data '{"jsonrpc": "2.0", "namespace":"global", "method":"tx_getBlockTransactionCountByHash", "params": ["0x7a87bd1fb51a86763e9791eab1d5ecca7f004bea1cfcc426113b4625d267f699"], "id": 71}'
  3.  
  4. # Response
  5. {
  6. "id":71,
  7. "jsonrpc": "2.0",
  8. "namespace":"global",
  9. "code": 0,
  10. "message": "SUCCESS",
  11. "result": "0xaf5"
  12. }

Example2:查询区块不存在

  1. # Request
  2. curl -X POST --data '{"jsonrpc": "2.0", "namespace":"global", "method":"tx_getBlockTransactionCountByHash", "params": ["0x7a87bd1fb51a86763e9791eab1d5ecca7f004bea1cfcc426113b4625d267f699"], "id": 71}'
  3.  
  4. # Response
  5. {
  6. "jsonrpc": "2.0",
  7. "namespace": "global",
  8. "id": 71,
  9. "code": -32001,
  10. "message":"Not found block 0x7a87bd1fb51a86763e9791eab1d5ecca7f004bea1cfcc426113b4625d267f699"
  11. }