天玄链功能接口列表

下列接口的示例中采用 curl 命令,curl 是一个利用 url 语法在命令行下运行的数据传输工具,通过 curl 命令发送 http post 请求,可以访问天玄链的 JSON RPC 接口。curl 命令的 url 地址设置为节点配置文件监听端口(gateway.http.port)。为了格式化 json ,使用 json工具进行格式化显示。

thanos_clientVersion

描述

  • 返回节点的版本信息

参数

返回值

  • object - 版本信息,字段如下:

    • version: string - 版本信息

  • 示例

// Request
curl http://127.0.0.1:8080/rpc  -X POST -d '{"jsonrpc":"2.0","method":"thanos_clientVersion","params":[],"id":1}' --header "Content-Type: application/json" | jq
 
// Result
{
  "id": 83,
  "jsonrpc": "2.0",
  "result": {
    "thanos/v1.0.0/Linux/Java/jdk1.8/1.0.0"
  }
}

thanos_sha3

描述

  • 计算参数的sha3的hash值,返回为16进制

参数

  • data: String - 元数据

返回值

  • string - 该元数据的hash值(0x开头的十六进制字符串)

  • 示例

thanos_net_version

描述

  • 返回thanos区块链组网版本

参数

返回值

  • string - thanos区块链组网版本

  • 示例

thanos_protocolVersion

描述

  • 返回thanos区块链协议版本

参数

返回值

  • string - thanos区块链协议版本

  • 示例

thanos_getCompilers

描述

  • 返回thanos区块链编译器

参数

返回值

  • string[] - thanos区块链编译器类型

  • 示例

thanos_sendEthRawTransaction

描述

  • 发送交易请求到区块链执行,返回交易hash

参数

  • rawData : String - rlp序列化后交易

返回值

  • string - 交易hash

  • 示例

thanos_ethCall

描述

  • 发送交易请求到区块链立即执行,无需共识

参数

  • rawData : String - rlp序列化后交易

返回值

  • string : - 交易执行回执

  • 示例

thanos_getLatestBeExecutedNum

描述

  • 获取目前最新被异步执行的区块块高

参数

返回值

  • Long : - 区块快高

  • 示例

thanos_getLatestConsensusNumber

描述

  • 获取目前最新被异步共识的区块块高

参数

返回值

  • Long : - 区块快高

  • 示例

thanos_getBlockByNumber

描述

  • 通过blockNumber获取区块链信息

参数

  • blockNumber : String - 区块链编号

返回值

  • string : - 区块链信息

  • 示例

thanos_getEthTransactionByHash

描述

  • 通过交易hash获取交易信息

参数

  • transactionHash : String - 交易hash

返回值

  • string : - 交易信息

  • 示例

thanos_getEthTransactionByHashByChain

描述

  • 通过交易hash获取交易信息

参数

  • transactionHash : String - 交易hash

返回值

  • string : - 交易信息

  • 示例

thanos_getEthTransactionsByHashes

描述

  • 通过交易hash批量获取交易信息

参数

  • transactionHashList : String - 交易hash

返回值

  • string : - 交易信息

  • 示例

thanos_getGlobalNodeEventByHash

描述

  • 通过全局节点事件hash获取事件信息

参数

  • eventHash : String - 事件hash

返回值

  • string : - 事件信息

  • 示例

thanos_getGlobalNodeEventReceiptByHash

描述

  • 通过全局节点事件hash获取事件回执

参数

  • eventHash : String - 事件hash

返回值

  • string : - 事件回执信息

  • 示例

thanos_getGlobalNodeEventByHashByChain

描述

  • 通过交易hash批量获取交易信息

参数

  • transactionHash : String - 交易hash

返回值

  • string : - 交易信息

  • 示例

Last updated