You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/ethereum/README.md
+46-35Lines changed: 46 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ This is the Well-Architected checklist for Ethereum nodes implementation of the
59
59
60
60
### Open AWS CloudShell
61
61
62
-
To begin, ensure you login to your AWS account with permissions to create and modify resources in IAM, EC2, EBS, VPC, S3, KMS, and Secrets Manager.
62
+
To begin, ensure you login to your AWS account with permissions to create and modify resources in IAM, EC2, EBS, VPC, and S3.
63
63
64
64
From the AWS Management Console, open the [AWS CloudShell](https://docs.aws.amazon.com/cloudshell/latest/userguide/welcome.html), a web-based shell environment. If unfamiliar, review the [2-minute YouTube video](https://youtu.be/fz4rbjRaiQM) for an overview and check out [CloudShell with VPC environment](https://docs.aws.amazon.com/cloudshell/latest/userguide/creating-vpc-environment.html) that we'll use to test nodes API from internal IP address space.
65
65
@@ -73,9 +73,7 @@ cd aws-blockchain-node-runners
73
73
npm install
74
74
```
75
75
76
-
> **NOTE:***In this tutorial we will set all major configuration through environment variables, but you also can modify parameters in `config/config.ts`.*
77
-
78
-
### Prepare to deploy nodes
76
+
### Prepare AWS account to deploy nodes
79
77
80
78
1. Make sure you are in the root directory of the cloned repository
81
79
@@ -89,11 +87,11 @@ aws ec2 create-default-vpc
89
87
90
88
> **NOTE:***The default VPC must have at least two public subnets in different Availability Zones, and public subnet must set `Auto-assign public IPv4 address` to `YES`*
91
89
92
-
3. With the [Node Runners blueprints for Ethereum](https://github.com/aws-samples/aws-blockchain-node-runners/tree/main/lib/ethereum), you can deploy both single Ethereum nodes and multi-node high-availability configurations on AWS. Furthermore, Node Runners is designed to support client diversity, with configurations available for a variety of client combinations for the Execution Layer (EL) and Consensus Layer (CL).
90
+
### Configure your setup
93
91
94
-
Configure your setup.
92
+
#### Execution and Consensus Layer Client Options
95
93
96
-
### Execution and Consensus Layer Client Options
94
+
With the [Node Runners blueprints for Ethereum](https://github.com/aws-samples/aws-blockchain-node-runners/tree/main/lib/ethereum), you can deploy both single Ethereum nodes and multi-node high-availability configurations on AWS. Furthermore, Node Runners is designed to support client diversity, with configurations available for a variety of client combinations for the Execution Layer (EL) and Consensus Layer (CL).
97
95
98
96
<details>
99
97
@@ -135,17 +133,17 @@ nano .env
135
133
136
134
<details>
137
135
138
-
<summary>Erigon Prysm</summary>
136
+
<summary>Reth Lighthouse</summary>
139
137
<br/>
140
138
141
-
**Configure your Node Runners Ethereum - Erigon Prysm**
139
+
**Configure your Node Runners Ethereum - Reth Lighthouse**
142
140
143
-
To specify the Ethereum client combination you wish to deploy, create your own copy of `.env` file and edit it using your preferred text editor. The contents of your file for a Erigon / Prysm node deployment is as follows, which uses a sample config from the repository:
141
+
To specify the Ethereum client combination you wish to deploy, create your own copy of `.env` file and edit it using your preferred text editor. The contents of your file for a Reth / Lighthouse node deployment is as follows, which uses a sample config from the repository:
144
142
```bash
145
143
# Make sure you are in aws-blockchain-node-runners/lib/ethereum
146
144
cd lib/ethereum
147
145
pwd
148
-
cp ./sample-configs/.env-erigon-prysm .env
146
+
cp ./sample-configs/.env-erigon-lighthouse .env
149
147
nano .env
150
148
```
151
149
> **NOTE:***You can find more examples inside the `sample-configs` directory, which illustrate other Ethereum client combinations.*
@@ -201,9 +199,32 @@ pwd
201
199
npx cdk deploy eth-common
202
200
```
203
201
204
-
### Option 1: Single RPC Node
202
+
### [OPTIONAL] (required only when ETH_SNAPSHOT_TYPE="s3") Deploy Sync Node
203
+
204
+
Sync node will sync with the network and periodically create data snapshots on S3 to speed up RPC nodes setup when `ETH_SNAPSHOT_TYPE="s3"`. It has no effect if `ETH_SNAPSHOT_TYPE="none"`.
205
+
206
+
1. Deploy `eth-sync-node` stack
207
+
208
+
```bash
209
+
pwd
210
+
# Make sure you are in aws-blockchain-node-runners/lib/ethereum
2. After starting the node you need to wait for the inital syncronization process to finish. It may take from half a day to about 6-10 days depending on the client combination and the state of the network. You can use Amazon CloudWatch to track the progress. There is a script that publishes CloudWatch metrics every 5 minutes, where you can watch `sync distance` for consensus client and `blocks behind` for execution client. When the node is fully synced those two metrics shold show 0. To see them:
215
+
216
+
- Navigate to [CloudWatch service](https://console.aws.amazon.com/cloudwatch/) (make sure you are in the region you have specified for `AWS_REGION`)
217
+
- Open `Dashboards` and select `eth-sync-node-<your-eth-client-combination>` from the list of dashboards.
218
+
219
+
Once synchronization process is over, the script will automatically stop both clients and copy all the contents of the `/data` directory to your snapshot S3 bucket. That may take from 30 minutes to about 2 hours. During the process on the dashboard you will see lower CPU and RAM utilization but high data disc throughput and outbound network traffic. The script will automatically start the clients after the process is done.
220
+
221
+
> **Note:***The snapshot backup process will automatically run ever day at midnight time of the time zone were the sync node runs. To change the schedule, modify `crontab` of the root user on the node's EC2 instance.*
222
+
223
+
### Deploy Standalone RPC Node
224
+
225
+
> **NOTE:***If `ETH_SNAPSHOT_TYPE="s3"` make sure you [deployed the Sync Node first](#optional-required-only-when-eth_snapshot_types3-deploy-sync-node).*
> **NOTE:***The default VPC must have at least two public subnets in different Availability Zones, and public subnet must set `Auto-assign public IPv4 address` to `YES`*
214
235
215
-
2.After starting the node you need to wait for the inital syncronization process to finish. It may take from half a day to about 6-10 days depending on the client combination and the state of the network. You can use Amazon CloudWatch to track the progress. There is a script that publishes CloudWatch metrics every 5 minutes, where you can watch `sync distance` for consensus client and `blocks behind` for execution client. When the node is fully synced those two metrics shold show 0. To see them:
236
+
2.If you haven't used `ETH_SNAPSHOT_TYPE="s3"` with Sync Node, then your node will start syncing by itself. In that case, after starting the node you need to wait for the inital syncronization process to finish. It may take from half a day to about 6-10 days depending on the client combination and the state of the network. You can use Amazon CloudWatch to track the progress. There is a script that publishes CloudWatch metrics every 5 minutes, where you can watch `sync distance` for consensus client and `blocks behind` for execution client. When the node is fully synced those two metrics shold show 0. To see them:
216
237
217
238
- Navigate to [CloudWatch service](https://console.aws.amazon.com/cloudwatch/) (make sure you are in the region you have specified for `AWS_REGION`)
218
-
- Open `Dashboards` and select `eth-sync-node-<your-eth-client-combination>` from the list of dashboards.
239
+
- Open `Dashboards` and select `eth-single-node-<your-eth-client-combination>` from the list of dashboards.
219
240
220
-
4. Once the initial synchronization is done, you should be able to access the RPC API of that node from within the same VPC. The RPC port is not exposed to the Internet. Turn the following query against the private IP of the single RPC node you deployed:
241
+
3. Once the initial synchronization is done, you should be able to access the RPC API of that node from within the same VPC. The RPC port is not exposed to the Internet. Turn the following query against the private IP of the single RPC node you deployed:
**NOTE:***The default VPC must have at least two public subnets in different Availability Zones, and public subnet must set `Auto-assign public IPv4 address` to `YES`*
264
+
### Deploy Highly Available RPC Nodes
253
265
254
-
2. After starting the node you need to wait for the inital syncronization process to finish. It may take from half a day to about 6-10 days depending on the client combination and the state of the network. You can use Amazon CloudWatch to track the progress. There is a script that publishes CloudWatch metrics every 5 minutes, where you can watch `sync distance` for consensus client and `blocks behind` for execution client. When the node is fully synced those two metrics shold show 0. To see them:
266
+
> **NOTE:***If `ETH_SNAPSHOT_TYPE="s3"` make sure you [deployed the Sync Node first](#optional-required-only-when-eth_snapshot_types3-deploy-sync-node).*
255
267
256
-
- Navigate to [CloudWatch service](https://console.aws.amazon.com/cloudwatch/) (make sure you are in the region you have specified for `AWS_REGION`)
257
-
- Open `Dashboards` and select `eth-sync-node-<your-eth-client-combination>` from the list of dashboards.
268
+
> **NOTE:***The default VPC must have at least two public subnets in different Availability Zones, and public subnet must set `Auto-assign public IPv4 address` to `YES`*
258
269
259
-
Once synchronization process is over, the script will automatically stop both clients and copy all the contents of the `/data` directory to your snapshot S3 bucket. That may take from 30 minutes to about 2 hours. During the process on the dashboard you will see lower CPU and RAM utilization but high data disc throughput and outbound network traffic. The script will automatically start the clients after the process is done.
270
+
1. Deploy Sync Node
260
271
261
-
> **Note:***The snapshot backup process will automatically run ever day at midnight time of the time zone were the syncnode runs. To change the schedule, modify `crontab` of the root user on the node's EC2 instance.*
272
+
Use instructions from earlier: [Deploy Sync Node](#optional-required-only-when-eth_snapshot_types3-deploy-sync-node)
262
273
263
-
3. Configure and deploy 2 RPC Nodes
274
+
2. Deploy `eth-rpc-nodes` stack
264
275
265
276
```bash
266
277
pwd
267
278
# Make sure you are in aws-blockchain-node-runners/lib/ethereum
4. Give the new RPC nodes about 30 minutes (up to 2 hours for Erigon) to initialize and then run the following query against the load balancer behind the RPC node created
282
+
3. Give the new RPC nodes about 30 minutes (up to 2 hours for Erigon) to initialize and then run the following query against the load balancer in front of your nods:
If the nodes are still starting and catching up with the chain, you will see the following repsonse:
302
+
If the nodes are still starting and catching up with the chain, you will see the following response:
292
303
293
304
```HTML
294
305
<html>
@@ -298,7 +309,7 @@ The result should be like this (the actual balance might change):
298
309
</body>
299
310
```
300
311
301
-
> **NOTE:** By default and for security reasons the load balancer is available only from within the default VPC in the region where it is deployed. It is not available from the Internet and is not open for external connections. Before opening it up please make sure you protect your RPC APIs.
312
+
> **NOTE:***By default and for security reasons the load balancer is available only from within the default VPC in the region where it is deployed. It is not available from the Internet and is not open for external connections. Before opening it up please make sure you protect your RPC APIs.*
0 commit comments