> For the complete documentation index, see [llms.txt](https://www.0x1.academy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.0x1.academy/gei-kai-fa-zhe-de-zhi-nan/public-chain/undefined-8.md).

# 測試網

### 測試網（Testnet）是區塊鏈的「練習場」。開發者可以在這裡測試智能合約、嘗試新功能，不用擔心損失真金白銀。測試網上的代幣都是免費的，沒有真實價值。

***

## 為什麼需要測試網？

想像你是一個廚師，要開發一道新菜。你會：

* **直接用最貴的食材實驗？** 太冒險了！
* **先用便宜的替代品練習？** 這才合理！

區塊鏈開發也一樣。在主網上部署智能合約需要真正的 ETH，如果合約有 bug，可能損失慘重。測試網讓你用「免費的練習幣」測試，發現問題也不心痛。

***

## 測試網的特點

| 特點   | 說明           |
| ---- | ------------ |
| 免費代幣 | 透過水龍頭免費領取    |
| 可重置  | 網路可以被重置，歷史清空 |
| 模擬主網 | 運作方式與主網相同    |
| 安全測試 | 即使出錯也不會損失真錢  |

***

## 以太坊的測試網

以太坊有多個測試網，各有用途：

| 測試網     | 共識機制 | 狀態  | 特點         |
| ------- | ---- | --- | ---------- |
| Sepolia | PoS  | 運作中 | 官方推薦的測試網   |
| Holesky | PoS  | 運作中 | 取代 Goerli  |
| Goerli  | PoS  | 已棄用 | 曾是最受歡迎的測試網 |

{% hint style="info" %}
**測試網的更迭**

測試網會隨著主網升級而更新。以太坊轉向 PoS 後，舊的 PoW 測試網（如 Ropsten、Rinkeby）都已停用。
{% endhint %}

***

## 如何使用測試網？

### 1. 設定錢包

在 MetaMask 中新增測試網路，輸入對應的 RPC 端點。

### 2. 領取測試幣

透過[水龍頭](/gei-kai-fa-zhe-de-zhi-nan/public-chain/undefined-8/shui.md)免費領取測試用的 ETH。

### 3. 部署測試

把智能合約部署到測試網，進行各種測試。

### 4. 確認無誤後上主網

測試完成，確認沒問題，才部署到主網。

***

## 開發流程

```
本地開發 → 測試網測試 → 安全審計 → 主網部署
```

這是標準的 DApp 開發流程。跳過測試網直接上主網是非常危險的行為。

***

## 延伸閱讀

* [水龍頭](/gei-kai-fa-zhe-de-zhi-nan/public-chain/undefined-8/shui.md) — 如何領取免費測試幣
* [主網](/gei-kai-fa-zhe-de-zhi-nan/public-chain/mainnet.md) — 正式的區塊鏈網路
* [智能合約](/zhi-neng-he-yue-de-shi-jie/smart-contract.md) — 需要在測試網上測試的程式

***

#### 參考資料

* [Ethereum Networks](https://ethereum.org/en/developers/docs/networks/)
* [Sepolia Testnet](https://sepolia.dev/)


---

# 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:

```
GET https://www.0x1.academy/gei-kai-fa-zhe-de-zhi-nan/public-chain/undefined-8.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.
