# 4.4 接口层

DxChain 3.0中将提供多种RPC服务，除了基于HTTP/HTTPs的RPC服务端，还将提供WebSocket与本地进程间的通信，以及进程内的RPC服务。DxChain 3.0中运用的JSON-RPC是一种基于JSON的跨语言远程调用协议，无状态且轻量级，具有文本传输数据小，便于调试扩展的特点。

<figure><img src="/files/ocorNJQc4MQgm4FUrAz5" alt=""><figcaption><p>图6：RPC处理</p></figcaption></figure>

DxChain节点提供的RPC服务可分为公开RPC接口、私有RPC接口、DPOS-RPC三大类。

1. 公开RPC接口\
   公开RPC接口是指所有RPC客户端都可以调用执行的API，可全面兼容和支持以太坊全部公开的RPC接口。
2. 私有RPC接口\
   私有RPC接口默认无法被HTTP和WS客户端调用执行，除非在gdx启动时指定外部用户可以访问的API，包含admin、miner、debug、account和eth等模块。
3. DPOS-RPC接口\
   DPOS-RPC接口是专为DPOS共识引擎提供查询和操作功能的接口，用户可通过该接口进行DPOS相关服务的查询，包含出块节点、候选节点、投票质押等的数据查询，申请、取消节点、投票、质押等相关交易操作。

除了传统的JSON-RPC以外，为了能让各种应用便捷地调用DxChain提供的区块链和智能合约服务，DxChain将支持各个语言版本的web3包，为各种应用接入DxChain链提供基础。web3服务提供了对链上RPC接口调用的一层封装，屏蔽了HTTP报文封装的格式和以太坊接口的技术细节，大大方便了各种Dapp快速集成DxChain服务。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dxchain.gitbook.io/dxchain-wiki/zhong-wen-she-qu/dxchain-v3-ji-shu-wen-dang/4.-ji-shu-de-she-ji-yuan-li-yu-jia-gou/4.4-jie-kou-ceng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
