Skip to content

Commit 34889d1

Browse files
committed
Base. Refactoring restoration of Archive nodes from snapshots
1 parent 974315e commit 34889d1

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ SNAPSHOT_FILE_NAME=snapshot.tar.gz
1111
SNAPSHOT_DIR=/data
1212

1313
LATEST_SNAPSHOT_FILE_NAME=$(curl https://$NETWORK_ID-$NODE_CONFIG-snapshots.base.org/latest) && \
14-
s5cmd --log error cp s3://base-snapshots-$NETWORK_ID-archive/$LATEST_SNAPSHOT_FILE_NAME /data && \
14+
s5cmd --log error cp s3://base-snapshots-$NETWORK_ID-archive/$LATEST_SNAPSHOT_FILE_NAME $SNAPSHOT_DIR/$SNAPSHOT_FILE_NAME && \
1515
echo "Downloading Snapshot script finished" && \
1616
sleep 60 &&\
1717
echo "Starting snapshot decompression ..." && \
1818
tar -zxvf $SNAPSHOT_DIR/$SNAPSHOT_FILE_NAME -C /data 2>&1 | tee unzip.log && echo "decompresed successfully..." || echo "decompression failed..." >> snapshots-decompression.log
1919

2020
echo "Decompresed snapshot, cleaning up..."
2121

22-
mv /data/snapshots/$NETWORK_ID/download/* /data && \
22+
mv /data/snapshots/$NETWORK_ID/download/* $SNAPSHOT_DIR && \
2323
rm -rf /data/snapshots && \
2424
rm -rf $SNAPSHOT_DIR/$SNAPSHOT_FILE_NAME
2525

2626
echo "Snapshot is ready, starting the service.."
2727

28-
chown -R bcuser:bcuser /data
28+
chown -R bcuser:bcuser $SNAPSHOT_DIR
2929

3030
sudo systemctl daemon-reload
3131
sudo systemctl enable --now base

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ AUTOSCALING_GROUP_NAME=${_AUTOSCALING_GROUP_NAME_}
77
RESOURCE_ID=${_NODE_CF_LOGICAL_ID_}
88
ASSETS_S3_PATH=${_ASSETS_S3_PATH_}
99
DATA_VOLUME_TYPE=${_DATA_VOLUME_TYPE_}
10+
DATA_VOLUME_SIZE=${_DATA_VOLUME_SIZE_}
1011
{
1112
echo "LIFECYCLE_HOOK_NAME=$LIFECYCLE_HOOK_NAME"
1213
echo "AUTOSCALING_GROUP_NAME=$AUTOSCALING_GROUP_NAME"
1314
echo "ASSETS_S3_PATH=$ASSETS_S3_PATH"
1415
echo "DATA_VOLUME_TYPE=$DATA_VOLUME_TYPE"
16+
echo "DATA_VOLUME_SIZE=$DATA_VOLUME_SIZE"
1517
} >> /etc/environment
1618

1719
arch=$(uname -m)
@@ -242,7 +244,6 @@ RestartSec=30
242244
User=bcuser
243245
Environment="PATH=/bin:/usr/bin:/home/bcuser/bin"
244246
ExecStart=/home/bcuser/bin/node-start.sh
245-
ExecStop=/home/bcuser/bin/node-stop.sh
246247
[Install]
247248
WantedBy=multi-user.target
248249
EOF'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BASE_CPU_TYPE="ARM_64" # All options: "x86_64", "ARM_64". IMPORT
1414

1515
# Data volume configuration
1616
BASE_DATA_VOL_TYPE="gp3" # Other options: "io1" | "io2" | "gp3" | "instance-store" . IMPORTANT: Use "instance-store" option only with instance types that support that feature, like popular for node im4gn, d3, i3en, and i4i instance families
17-
BASE_DATA_VOL_SIZE="7200" # Current required data size in GB to keep both snapshot archive and unarchived version of it. For Sepolia 1000 will be sufficient.
17+
BASE_DATA_VOL_SIZE="1000" # Current required data size in GB to keep both snapshot archive and unarchived version of it. For Sepolia 1000 will be sufficient.
1818
BASE_DATA_VOL_IOPS="5000" # Max IOPS for EBS volumes (not applicable for "instance-store")
1919
BASE_DATA_VOL_THROUGHPUT="700" # Max throughput for EBS gp3 volumes (not applicable for "io1" | "io2" | "instance-store")
2020
BASE_L1_EXECUTION_ENDPOINT="https://ethereum-sepolia-rpc.publicnode.com" # Set your own URL to Ethereum L1 node: https://docs.base.org/tools/node-providers
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"base-single-node-archive-mainnet": {
3-
"nodeinstanceid": "i-03efb8b36f80c2fd1"
3+
"nodeinstanceid": "i-09785d994a9adcadd"
44
}
55
}

0 commit comments

Comments
 (0)