> For the complete documentation index, see [llms.txt](https://docs-cn.filswan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-cn.filswan.com/swan-client/chuang-jian-ren-wu-liu-cheng/qu-kuai-lian-rpc-fu-wu/rpc-ming-ling.md).

# RPC 命令

此 RPC 命令可以帮你查询最新的链高度和钱包余额，Ethereum 和 Binance Smart Chain的示例如下：

* **Ethereum 主网**:

查询当前链高度

```
swan-client rpc height --chain ETH
```

输出：

```
	Chain: ETH
	Height: 15844685
```

查询余额

```
swan-client rpc balance --chain ETH --address 0x29D5527CaA78f1946a409FA6aCaf14A0a4A0274b
```

输出：

```
	Chain: ETH
	Height: 15844698
	Address: 0x29D5527CaA78f1946a409FA6aCaf14A0a4A0274b
	Balance: 749.53106079798394945
```

* **Binance Smart Chain 主网**:

查询当前链高度

```
swan-client rpc height --chain BNB
```

输出：

```
	Chain: BNB
	Height: 22558967
```

查询余额

```
swan-client rpc balance --chain BNB --address 0x4430b3230294D12c6AB2aAC5C2cd68E80B16b581
```

输出：

```
	Chain: BNB
	Height: 22559008
	Address: 0x4430b3230294D12c6AB2aAC5C2cd68E80B16b581
	Balance: 0.027942338705784518
```

* 查看 [此处](https://github.com/filswan/go-swan-client/blob/main/document/rpc-cmd-example.md)，了解更多更多 JSON-RPC 方法


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs-cn.filswan.com/swan-client/chuang-jian-ren-wu-liu-cheng/qu-kuai-lian-rpc-fu-wu/rpc-ming-ling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
