Skip to content

Commit 7f3eb45

Browse files
committed
Base. Pre-review fixes
1 parent b11dd08 commit 7f3eb45

15 files changed

+59
-21
lines changed

lib/base/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ npx cdk deploy base-common
124124
125125
### Option 1: Deploy Single Node
126126
127-
1. For L1 node you you can set your own URLs in `BASE_L1_EXECUTION_ENDPOINT` and `BASE_L1_CONSENSUS_ENDPOINT` properties of `.env` file. It can be one of [the providers recommended by Base](https://docs.base.org/tools/node-providers) or you can run your own Ethereum node [with Node Runner Ethereum blueprint](https://aws-samples.github.io/aws-blockchain-node-runners/docs/Blueprints/Ethereum) (tested with geth-lighthouse combination). For example:
127+
1. For L1 node you you can set your own URLs in `BASE_L1_EXECUTION_ENDPOINT` and `BASE_L1_CONSENSUS_ENDPOINT` properties of `.env` file. It can be one of [the providers recommended by Base](https://docs.base.org/tools/node-providers) or you can run your own Ethereum node [with Node Runner Ethereum blueprint](https://aws-samples.github.io/aws-blockchain-node-runners/docs/Blueprints/Ethereum) (tested with single-node geth-lighthouse combination). For example:
128128
129129
```bash
130130
#For Sepolia:
@@ -181,7 +181,7 @@ BASE_L1_CONSENSUS_ENDPOINT="https://ethereum-sepolia-beacon-api.publicnode.com"
181181
npx cdk deploy base-ha-nodes --json --outputs-file ha-nodes-deploy.json
182182
```
183183

184-
2. Give the new RPC **full** nodes about 2-3 hours (24 hours for **archive** node) to initialize and then run the following query against the load balancer behind the RPC node created
184+
2. Give the new RPC **full** nodes about 5 hours to initialize and then run the following query against the load balancer behind the RPC node created.
185185

186186
```bash
187187
export RPC_ALB_URL=$(cat ha-nodes-deploy.json | jq -r '..|.alburl? | select(. != null)')
@@ -197,6 +197,8 @@ BASE_L1_CONSENSUS_ENDPOINT="https://ethereum-sepolia-beacon-api.publicnode.com"
197197

198198
**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.
199199

200+
**NOTE:** We currently don't recommend running **archive** nodes in HA setup, because it takes way too long to get them synced. Use single-node setup instead.
201+
200202
### Monitoring
201203
Every 5 minutes a script on the Base node publishes to CloudWatch service the metrics for current block for L1/L2 clients as well as blocks behind metric for L1 and minutes behind for L2. When the node is fully synced the blocks behind metric should get to 4 and minutes behind should get down to 0. To see the metrics for **single node only**:
202204

lib/base/lib/assets/base/node-start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ echo "Script is starting..."
66
cd /home/bcuser/node
77
/usr/local/bin/docker-compose -f /home/bcuser/node/docker-compose.yml up -d
88

9-
echo "Started"
9+
echo "Started"

lib/base/lib/assets/base/node-stop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ echo "Script is stopping the node..."
66
cd /home/bcuser/node
77
/usr/local/bin/docker-compose -f /home/bcuser/node/docker-compose.yml down
88

9-
echo "Stopped"
9+
echo "Stopped"

lib/base/lib/assets/restore-from-snapshot-archive-s3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ echo "Snapshot is ready, starting the service.."
2828
chown -R bcuser:bcuser $SNAPSHOT_DIR
2929

3030
sudo systemctl daemon-reload
31-
sudo systemctl enable --now base
31+
sudo systemctl enable --now base

lib/base/lib/assets/restore-from-snapshot-http.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ echo "Snapshot is ready, starting the service.."
5959
chown -R bcuser:bcuser /data
6060

6161
sudo systemctl daemon-reload
62-
sudo systemctl enable --now base
62+
sudo systemctl enable --now base

lib/base/lib/assets/setup-instance-store-volumes.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [ -n "$DATA_VOLUME_ID" ]; then
1515
echo "Data volume formatted. Mounting..."
1616
echo "waiting for volume to get UUID"
1717
OUTPUT=0;
18-
while [ "$OUTPUT" = 0 ]; do
18+
while [ "$OUTPUT" = 0 ]; do
1919
DATA_VOLUME_UUID=$(lsblk -fn -o UUID $DATA_VOLUME_ID)
2020
OUTPUT=$(echo $DATA_VOLUME_UUID | grep -c - $2)
2121
echo $OUTPUT
@@ -41,4 +41,4 @@ if [ -n "$DATA_VOLUME_ID" ]; then
4141
else
4242
echo "Data volume is mounted, nothing changed"
4343
fi
44-
fi
44+
fi

lib/base/lib/assets/user-data/node.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ L1_EXECUTION_ENDPOINT=${_L1_EXECUTION_ENDPOINT_}
9999
L1_CONSENSUS_ENDPOINT=${_L1_CONSENSUS_ENDPOINT_}
100100
SNAPSHOT_URL=${_SNAPSHOT_URL_}
101101

102-
{
102+
{
103103
echo "REGION=$REGION"
104104
echo "NETWORK_ID=$NETWORK_ID"
105105
echo "NODE_CONFIG=$NODE_CONFIG"
@@ -278,7 +278,7 @@ fi
278278
mkfs -t ext4 $DATA_VOLUME_ID
279279
echo "waiting for volume to get UUID"
280280
OUTPUT=0;
281-
while [ "$OUTPUT" = 0 ]; do
281+
while [ "$OUTPUT" = 0 ]; do
282282
DATA_VOLUME_UUID=$(lsblk -fn -o UUID $DATA_VOLUME_ID)
283283
OUTPUT=$(echo $DATA_VOLUME_UUID | grep -c - $2)
284284
echo $OUTPUT
@@ -309,8 +309,8 @@ if [[ "$LIFECYCLE_HOOK_NAME" != "none" ]]; then
309309
echo "Signaling ASG lifecycle hook to complete"
310310
TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
311311
INSTANCE_ID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/instance-id)
312-
aws autoscaling complete-lifecycle-action --lifecycle-action-result CONTINUE --instance-id $INSTANCE_ID --lifecycle-hook-name "$LIFECYCLE_HOOK_NAME" --auto-scaling-group-name "$AUTOSCALING_GROUP_NAME" --region $AWS_REGION
312+
aws autoscaling complete-lifecycle-action --lifecycle-action-result CONTINUE --instance-id $INSTANCE_ID --lifecycle-hook-name "$LIFECYCLE_HOOK_NAME" --auto-scaling-group-name "$AUTOSCALING_GROUP_NAME" --region $REGION
313313
fi
314314

315315
echo "All Done!!"
316-
set -e
316+
set -e

lib/base/lib/config/baseConfig.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ export interface BaseHAConfig {
2828
albHealthCheckGracePeriodMin: number;
2929
heartBeatDelayMin: number;
3030
numberOfNodes: number;
31-
}
31+
}

lib/base/sample-configs/.env-sample-archive

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ BASE_SNAPSHOT_URL="none" # Optionally provide the URL to download
3333
## HA nodes configuration ##
3434
BASE_HA_NUMBER_OF_NODES="2" # Total number of RPC nodes to be provisioned. Default: 2
3535
BASE_HA_ALB_HEALTHCHECK_GRACE_PERIOD_MIN="300" # Time enough to initialize the instance
36-
BASE_HA_NODES_HEARTBEAT_DELAY_MIN="1440" # Time sufficient enough for a node do sync
36+
BASE_HA_NODES_HEARTBEAT_DELAY_MIN="1440" # Time sufficient enough for a node do sync

lib/base/sample-configs/.env-sample-full

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ BASE_SNAPSHOT_URL="none" # Optionally provide the URL to download
3232

3333
## HA nodes configuration ##
3434
BASE_HA_NUMBER_OF_NODES="2" # Total number of RPC nodes to be provisioned. Default: 2
35-
BASE_HA_ALB_HEALTHCHECK_GRACE_PERIOD_MIN="300" # Time enough to initialize the instance
36-
BASE_HA_NODES_HEARTBEAT_DELAY_MIN="120" # Time sufficient enough for a node do sync
35+
BASE_HA_ALB_HEALTHCHECK_GRACE_PERIOD_MIN="500" # Time enough to initialize the instance
36+
BASE_HA_NODES_HEARTBEAT_DELAY_MIN="120" # Time sufficient enough for a node do sync

0 commit comments

Comments
 (0)