4.2 查询指定区间的区块by block number

getBlocks

参数:

  • from 起始区块号。
  • to 终止区块号。
  • isPlain (可选),默认为false,表示返回的区块包括区块内的交易信息,如果指定为true,表示返回的区块不包括区块内的交易。
  • nodeIds 说明请求向哪些节点发送。
  1. Request<BlockResponse> getBlocks(BigInteger from, BigInteger to, int... nodeIds);
  2. Request<BlockResponse> getBlocks(BigInteger from, BigInteger to, boolean isPlain, int... nodeIds);

重载方法如下:

  1. Request<BlockResponse> getBlocks(String from, String to, int... nodeIds);
  2. Request<BlockResponse> getBlocks(String from, String to, boolean isPlain, int... nodeIds);