更新时间:2022-08-30 GMT+08:00
分享

查询区块详情

  1. 消息构建。

    • 接口方法
      func (msg *QueryRawMessage) BuildBlockRawMessage(chainID string, blockNum uint64) (*common.RawMessage, error)
    • 参数说明

      参数

      类型

      说明

      chainID

      string

      链ID。

      blockNum

      uint64

      区块高度。

    • 返回值

      类型

      说明

      *common.RawMessage

      根据块高查询区块详情需发送的消息。

      error

      查询成功返回类型为nil,反之返回error。

  2. 消息发送。

    • 接口方法
      func (action *QueryAction) GetBlockByNum(rawMsg *common.RawMessage) (*common.RawMessage, error)
    • 参数说明

      参数

      类型

      说明

      rawMsg

      *common.RawMessage

      上述根据块高查询区块详情消息。

    • 返回值

      类型

      说明

      *common.RawMessage

      用于获取包含发送结果的消息。

      error

      发送成功返回类型为nil,反之返回error。

分享:

    相关文档

    相关产品