1. RPC 要求使用 POST 请求

2. 交互协议为 Json 格式

3. 请求地址组成

  http://[节点 ip]:[rpc 端口号],如:http://172.30.143.249:8336

4. 添加接口认证

Omni RPC 接口使用

 

 

5. 请求参数

{"jsonrpc":"2.0", "method": "omni_getinfo", "params":[283729]}

jsonrpc:也可不用管(参数可有可无)。

method:请求的接口名(参数必须有),如:omni_getinfo、omni_listblocktransactions、omni_gettransaction ......。

params:接口参数(接口有参数时必须有对应参数输入,可有可无)

 

6. rpc 接口实现示例

使用工具 ApiPost

接口相关使用说明:https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md

 

6.1 获取节点详情

参数:{"jsonrpc":"2.0", "method": "omni_getinfo", "params":[]} 或 {"method": "omni_getinfo"}

Omni RPC 接口使用

 

 6.2 获取块中所有交易 hash

参数:{"method": "omni_listblocktransactions", "params":[283729]}

Omni RPC 接口使用

 

6.3 获取交易详情

参数:{"method": "omni_gettransaction" , "params":["7d7f605408950be57fa0ebc4392403fea5a15da1897796f7607d75194e152b73"]}

Omni RPC 接口使用

 

Omni 节点搭建请参考:https://www.cnblogs.com/wf-l5201314/p/11969636.html

 

go 实现:https://www.cnblogs.com/wf-l5201314/p/11969792.html

相关文章:

  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2022-01-13
  • 2021-06-17
  • 2021-09-03
  • 2022-12-23
  • 2021-04-14
  • 2021-09-30
相关资源
相似解决方案