-
Notifications
You must be signed in to change notification settings - Fork 1
/
aptos-waypoint-update.sh
35 lines (26 loc) · 1.01 KB
/
aptos-waypoint-update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
cd $HOME
sudo mkdir -p /opt/aptos/etc/
sudo systemctl stop aptosd
if [ -f /opt/aptos/etc/genesis.blob ]; then
echo "Genesis exists."
else
echo "Starting download Genesis..."
wget -q -O /opt/aptos/etc/genesis.blob https://devnet.aptoslabs.com/genesis.blob
echo "Genesis successfully downloaded."
sleep 2
fi
if [ -f /opt/aptos/etc/waypoint.txt ]; then
echo "Waypoint exists."
else
echo "Starting download Waypoint..."
wget -q -O /opt/aptos/etc/waypoint.txt https://devnet.aptoslabs.com/waypoint.txt
echo "Waypoint successfully downloaded."
sleep 2
fi
echo "Starting update Genesis and Waypoint in config file..."
sed -i "s/genesis_file_location: .*/genesis_file_location: \"\/opt\/aptos\/etc\/genesis.blob\"/" $HOME/.aptos/config/public_full_node.yaml
sed -i "s/from_file: .*/from_file: \"\/opt\/aptos\/etc\/waypoint.txt\"/" $HOME/.aptos/config/public_full_node.yaml
echo "Genesis and Waypoint successfully updated in config file."
sleep 2
sudo systemctl restart aptosd