Skip to content

Commit 6b99828

Browse files
committed
Adding sync script
1 parent 606ac12 commit 6b99828

File tree

1 file changed

+31
-0
lines changed
  • lib/sui/lib/assets/user-data

1 file changed

+31
-0
lines changed

lib/sui/lib/assets/user-data/sync.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
set -e # Exit immediately if a command exits with a non-zero status
4+
5+
sudo apt-get install -y libpq-dev
6+
7+
# Stop fullnode
8+
sudo systemctl stop suid || true # Continue even if suid is not running
9+
10+
# Create a sui-tool folder and switch to it
11+
mkdir -p ~/sui-tool
12+
cd ~/sui-tool
13+
14+
# Downloading sui-tool
15+
wget https://github.com/MystenLabs/sui/releases/download/mainnet-v1.27.4/sui-mainnet-v1.27.4-ubuntu-x86_64.tgz
16+
tar -xvzf sui-mainnet-v1.27.4-ubuntu-x86_64.tgz
17+
sudo mv ./sui-tool /usr/local/bin/
18+
19+
# Run sui tool to download the latest epoch
20+
sui-tool download-db-snapshot --latest --network testnet --path /home/ubuntu/.sui/db --num-parallel-downloads 50 --skip-indexes --no-sign-request
21+
22+
# Verify the download completion
23+
if [ $? -eq 0 ]; then
24+
echo "Download completed successfully."
25+
else
26+
echo "Download failed." >&2
27+
exit 1
28+
fi
29+
30+
# Start fullnode
31+
sudo systemctl start suid

0 commit comments

Comments
 (0)