

AWS 區塊鏈範本已於 2019 年 4 月 30 日終止。不會進一步更新此服務或此支援文件。為了獲得最佳的受管區塊鏈體驗 AWS，我們建議您使用 [ Amazon Managed Blockchain (AMB)](https://aws.amazon.com/managed-blockchain/)。若要進一步了解 Amazon Managed Blockchain 入門，請參閱 [ Hyperledger Fabric 上的研討會](https://catalog.us-east-1.prod.workshops.aws/workshops/008da2cb-8454-42d0-877b-bc290bff7fcf/en-US)，或[有關部署 Ethereum 節點的部落格](https://aws.amazon.com/blogs/database/deploy-an-ethereum-node-on-amazon-managed-blockchain/)。如果您對 AMB 有任何疑問或需要進一步支援，[請聯絡 支援](https://console.aws.amazon.com/support/home#/case/create?issueType=technical) 或您的 AWS 客戶團隊。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建立 Ethereum 網路
<a name="blockchain-templates-create-stack"></a>

您在本主題中使用 範本指定的 Ethereum 網路會啟動 CloudFormation 堆疊，為 Ethereum 網路建立 EC2 執行個體的 Amazon ECS 叢集。範本需倚賴您稍早在[設定先決條件](blockchain-template-getting-started-prerequisites.md) 中建立的資源。

當您使用 範本啟動 CloudFormation 堆疊時，它會為某些任務建立巢狀堆疊。上述工作完成後，您可以透過堡壘主機連線到網路的 Application Load Balancer 提供的資源，確認您的 Ethereum 網路可以執行並可供存取。

**使用適用於 Ethereum 的 AWS 區塊鏈範本建立 Ethereum 網路**

1. 請參閱 [AWS 區塊鏈範本入門](https://aws.amazon.com/blockchain/templates/getting-started/)，並使用您 AWS 區域的快速連結，在 CloudFormation 主控台中開啟適用於 Ethereum 的最新 AWS 區塊鏈範本。

1. 根據下列指導方針輸入值：
   + 對於 **Stack name (堆疊名稱)**，輸入您可輕鬆識別的名稱。這個名稱將用於堆疊建立的資源名稱中。
   + 在 **Ethereum Network Parameters (Ethereum 網路參數)** 和 **Private Ethereum Network Parameters (私有 Ethereum 網路參數)** 下，保留預設設定。
**警告**  
預設帳戶和相關聯的助憶鍵片語僅供測試之用。不要使用預設的一組帳戶傳送發送真實的 Ether，因為可存取助憶鍵片語的任何人都能存取或 Ether 或從帳戶竊取 Ether。相反地，為了生產目的才指定自訂帳戶。與預設帳戶相關聯的助憶鍵片語是 `outdoor father modify clever trophy abandon vital feel portion grit evolve twist`。
   + 在**平台組態**下，保留預設設定，這會建立 EC2 執行個體的 Amazon ECS 叢集。另一個方法 **docker-local**，則會使用單一 EC2 執行個體建立 Ethereum 網路。
   + 在 **EC2 configuration (EC2 組態)** 下，根據下列指導方針選取選項：
     + 對於 **EC2 Key Pair (EC2 金鑰對)**，選取金鑰對。如需建立金鑰對的相關資訊，請參閱[建立金鑰對](blockchain-templates-setting-up.md#blockchain-templates-create-a-key-pair)。
     + 對於 **EC2 Security Group (EC2 安全群組)**，選取您稍早在[建立安全群組](blockchain-template-getting-started-prerequisites.md#blockchain-templates-create-security-group) 中建立的安全群組。
     + 對於 **EC2 Instance Profile ARN (EC2 執行個體描述檔 ARN)**，輸入您稍早在[為 Amazon ECS 和 EC2 執行個體設定檔建立 IAM 角色](blockchain-template-getting-started-prerequisites.md#blockchain-templates-iam-roles) 中建立的執行個體描述檔 ARN。
   + 在 **VPC network configuration (VPC 網路組態)** 下，根據下列指導方針選取選項：
     + 對於 **VPC ID**，選取您稍早在[建立 VPC 和子網路](blockchain-template-getting-started-prerequisites.md#blockchain-templates-create-a-vpc) 中建立的 VPC。
     + 對於 **Ethereum Network Subnet IDs (Ethereum 網路子網路 ID)**，選取您稍早在[To create the VPC](blockchain-template-getting-started-prerequisites.md#create-vpc-procedure) 程序中建立的單一私有子網路。
   + 在 **ECS cluster configuration (ECS 叢集組態)** 下，保留預設值。這會建立一個包含三個 EC2 執行個體的 ECS 叢集。
   + 在 **Application Load Balancer configuration (ECS only) (Application Load Balancer 組態 (僅限 ECS))**，根據下列指導方針選取選項：
     + 對於 **Application Load Balancer Subnet IDs (Application Load Balancer 子網路 ID)**，從您稍早記下的[list of subnets](blockchain-template-getting-started-prerequisites.md#list-of-subnets) 中，選取兩個公有子網路。
     + 對於 **Application Load Balancer Security Group (Application Load Balancer 安全群組)**，選取您稍早在[建立安全群組](blockchain-template-getting-started-prerequisites.md#blockchain-templates-create-security-group) 中建立的 Application Load Balancer 安全群組。
     + 針對 **IAM 角色**，輸入您先前在 中建立之 ECS 角色的 ARN[為 Amazon ECS 和 EC2 執行個體設定檔建立 IAM 角色](blockchain-template-getting-started-prerequisites.md#blockchain-templates-iam-roles)。
   + 在 **EthStats** 下，根據下列指導方針選取選項：
     + 對於 **Deploy EthStats (部署 EthStats)**，保留預設設定，也就是 *true*。
     + 對於 **EthStats Connection Secret (EthStats 連線密碼)**，輸入至少六個字元的任意值。
   + 在 **EthExplorer** 下，為 **Deploy EthExplorer (部署 EthExplorer)** 保留預設設定，也就是 *true*。
   + 在 **Other parameters (其他參數)** 下，為 **Nested Template S3 URL Prefix (巢狀範本 S3 URL 前綴)** 保留預設值，並記下該值。這是您可以找到巢狀範本的地方。

1. 保留所有其他設定的預設值、選取確認核取方塊，然後選擇 **Create (建立)**。

    CloudFormation 啟動的根堆疊的**堆疊詳細資訊**頁面隨即出現。

1. 若要監控根堆疊和巢狀堆疊的進度，請選擇 **Stacks (堆疊)**。  
![\[CloudFormation interface showing Stacks option highlighted in the navigation menu.\]](http://docs.aws.amazon.com/zh_tw/blockchain-templates/latest/developerguide/images/choose-stacks.png)

1. 當所有堆疊顯示 **CREATE\$1COMPLETE** for **Status** 時，您可以連線至 Ethereum 使用者介面，以確認網路正在執行並可存取。使用 ECS 容器平台時，透過 Application Load Balancer 連線到 EthStats、EthExplorer 和 EthJsonRPC 的 URL 會顯示在根堆疊的 **Outputs (輸出)** 標籤中。
**重要**  
在透過用戶端電腦上的堡壘主機設定代理連線之前，您無法直接連線至這些 URL 或 SSH。如需詳細資訊，請參閱[使用堡壘主機連線到 EthStats 和 EthExplorer](blockchain-bastion-host-connect.md)。  
![\[CloudFormation console showing Ethereum network stack details and output URLs.\]](http://docs.aws.amazon.com/zh_tw/blockchain-templates/latest/developerguide/images/stack-urls.png)