跳至主要內容

Sonic QuickStart

更新於
2026年3月27日

The quickest way to start building on Sonic with Quicknode is by sending a JSON-RPC request to your endpoint. In this quickstart, you’ll create an endpoint, copy its provider URL, and make your first request. Code samples below use cURL and common languages.

Get Your Sonic Endpoint

1

建立 Quicknode 帳戶

若您尚未註冊,請點此註冊。

2

前往您的儀表板

從左側邊欄選單開啟「端點」儀表板,以管理您所有的區塊鏈端點

3

建立新的端點

Click Create an Endpoint in the top-right corner, select Sonic as your blockchain, then select your preferred network

4

複製您的服務供應商網址

請將該 HTTP URL 備妥。您將在以下請求中使用它。

進一步了解儀表板

如需了解 Quicknode 儀表板的詳細操作指南,請參閱我們的 指南

發送您的第一個請求

Your endpoint is ready. Now, let's make your first call to the Sonic network. We’ll use the eth_blockNumber method, which returns the latest block number. Select your preferred language or SDK and follow the steps below to send your first request.


1

檢查 cURL 的安裝狀況

大多數基於 *nix 的系統預設即支援 cURL。請開啟終端機,並執行以下指令以檢查 cURL 的版本:

curl --version
2

傳送一個 JSON-RPC 請求

在您的終端機中,複製並貼上以下 cURL 指令以取得最新的區塊編號:

curl -X POST YOUR_QUICKNODE_ENDPOINT_URL/ \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
3

範例回應

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1234567"
}

如果您想進一步了解如何發送 API 請求,請參閱我們的指南和 範例應用程式

我們 ❤️ 您的回饋!

如果您對這份文件有任何意見或疑問,請告訴我們。我們非常樂意聽取您的意見!

分享這份文件