

Amazon Web Services Blockchain Templates 已于 2019 年 4 月 30 日停产。不会对本服务或本支持文档进行进一步更新。为了获得最佳的托管区块链体验 AWS，我们建议您使用[亚马逊托管区块链 (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>

您使用本主题中的模板指定的以太坊网络会启动一个 CloudFormation 堆栈，该堆栈用于为以太坊网络创建 Amazon ECS EC2 实例集群。该模板依赖于您以前在[设置先决条件](blockchain-template-getting-started-prerequisites.md)中创建的资源。

当您使用模板启动 CloudFormation 堆栈时，它会为某些任务创建嵌套堆栈。完成后，您可以通过堡垒主机连接到网络的应用程序负载均衡器提供的资源，以验证 Ethereum 网络是否正在运行并且可访问。

**使用适用于 Ethereum 的 Amazon Web Services Blockchain Templates 创建 Ethereum 网络**

1. 请参阅 [AWS Blockchain Templates 入门](https://aws.amazon.com/blockchain/templates/getting-started/)，并使用您的 AWS 区域的快速链接在 CloudFormation 控制台中打开适用于以太坊的最新 AWS 区块链模板。

1. 根据以下准则输入值：
   + 对于 **Stack name (堆栈名称)**，输入一个易于识别的名称。此名称用于堆栈创建的资源名称中。
   + 在 **Ethereum Network Parameters (Ethereum 网络参数)** 和 **Private Ethereum Network Parameters (私有 Ethereum 网络参数)** 下面，保留默认设置。
**警告**  
仅出于测试目的使用默认账户和关联的助记词。请勿使用默认账户集发送真实的 Ether，因为任何有权访问助记词的人都可以从账户中访问或窃取 Ether。相反，应出于生产目的指定自定义账户。与默认账户关联的助记词为 `outdoor father modify clever trophy abandon vital feel portion grit evolve twist`。
   + 在**平台配置**下，保留默认设置，这将创建一个 Amazon ECS EC2 实例集群。另一种选择，**docker-local** 使用单个实例创建以太坊网络。 EC2 
   + 在 “**EC2 配置**” 下，根据以下准则选择选项：
     + 在 “**EC2 密钥对**” 中，选择一个密钥对。有关创建密钥对的信息，请参阅 [创建密钥对](blockchain-templates-setting-up.md#blockchain-templates-create-a-key-pair)。
     + 对于**EC2 安全组**，请选择您之前在中创建的安全组[创建安全组](blockchain-template-getting-started-prerequisites.md#blockchain-templates-create-security-group)。
     + 对于**EC2 实例配置文件 ARN**，请输入您之前在中创建的实例配置文件的 ARN。[为 Amazon ECS 创建 IAM 角色和 EC2 实例配置文件](blockchain-template-getting-started-prerequisites.md#blockchain-templates-iam-roles)
   + 在 **VPC network configuration (VPC 网络配置)** 下面，根据以下准则选择选项：
     + 对于 **VPC ID**，选择您以前在[创建 VPC 和子网](blockchain-template-getting-started-prerequisites.md#blockchain-templates-create-a-vpc)中创建的 VPC。
     + 对于**以太坊网络子网 IDs**，请选择您在前面步骤中创建的单个私有子网[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) (应用程序负载均衡器配置 (仅 ECS))** 下面，根据以下准则选择选项：
     + 对于 **Application Load Balancer 子 IDs**网，请从您之前提到[list of subnets](blockchain-template-getting-started-prerequisites.md#list-of-subnets)的中选择两个公有子网。
     + 对于 **Application Load Balancer Security Group (应用程序负载均衡器安全组)**，选择您以前在[创建安全组](blockchain-template-getting-started-prerequisites.md#blockchain-templates-create-security-group)中创建的应用程序负载均衡器的安全组。
     + 对于 **IAM 角色**，输入您以前在[为 Amazon ECS 创建 IAM 角色和 EC2 实例配置文件](blockchain-template-getting-started-prerequisites.md#blockchain-templates-iam-roles)中创建的 ECS 角色的 ARN。
   + 在下方 **EthStats**，根据以下准则选择选项：
     + 对于 **Deploy EthStats**，保留默认设置，该设置为 *true*。
     + 对于 “**EthStats 连接密钥**”，键入一个至少为六个字符的任意值。
   + 在下方 **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_cn/blockchain-templates/latest/developerguide/images/choose-stacks.png)

1. 当所有堆栈的**状态**显示**CREATE\$1COMPLETE**时，您可以连接到 Ethereum 用户界面，以验证网络是否正在运行且可以访问。当您使用 ECS 容器平台时， URLs 根堆栈的 “**输出**” 选项卡上可以通过 Application Load Balancer 连接到 EthExplorer、和 EthJson RPC。 EthStats
**重要**  
在通过客户端计算机上的堡垒主机设置代理连接之前，您将无法直接连接到这些服务器 URLs 或直接连接 SSH。有关更多信息，请参阅 [连接 EthStats 并 EthExplorer 使用堡垒主机](blockchain-bastion-host-connect.md)。  
![\[CloudFormation console showing Ethereum network stack details and output URLs.\]](http://docs.aws.amazon.com/zh_cn/blockchain-templates/latest/developerguide/images/stack-urls.png)