Trong lần trước, mình đã hướng dẫn anh em chạy testnet Sui Wave 1, nếu không may bị loại ở đợt testnet trước đó, anh em có thể thử sức với Testnet Wave 2 mà mình hướng dẫn dưới đây nhé!
Cài đặt Virtual Private Servers (VPS)
Để tham gia chạy node testnet Wave 2 của Sui blockchain, anh em cần phải mua VPS và tiến hành setup cơ bản cho VPS.
Để cài đặt VPS anh em xem lại tại đây.
Hướng dẫn chạy Testnet Wave 2
Lưu ý trước khi bước vào phần hướng dẫn chạy node: Nếu anh em gặp lỗi với kí tự “‐‐” khi paste code từ bài viết thì vui lòng xóa và chỉnh lại kí tự trước khi paste code vào PuTTY (Terminal đối với MacOSS) giúp mình nhé!
Bước 1: Update & set enviroment
sudo apt update && sudo apt upgrade -y
Tiếp theo,
apt-get update \
&& DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y ‐‐no-install-recommends \
tzdata \
git \
ca-certificates \
curl \
build-essential \
libssl-dev \
pkg-config \
libclang-dev \
cmake
Install RUST:
curl ‐‐proto '=https' ‐‐tlsv1.2 -sSf https://sh.rustup.rs | sh -s ‐‐ -y
Sau đó,
source $HOME/.cargo/env
Rust update for command:
rustup update
Use screen:
apt-get install screen
Bước 2: Open port
cd $home
apt install ufw -y
ufw allow ssh
ufw allow https
ufw allow http
ufw allow 9000
ufw allow 9184
ufw enable
Bước 3: Install Sui Binaries
cargo install ‐‐locked ‐‐git https://github.com/MystenLabs/sui.git ‐‐branch testnet sui sui-node
Bước 4: Integrated Development Environment
cargo install ‐‐git https://github.com/move-language/move move-analyzer ‐‐features "address20"
Bước 5: Sui Tokens
Tạo ví mới:
sui client active-address
Nhấn Y và enter,
Tiếp tục nhấn enter,
Nhấn 0 và enter,
Lưu ý: Lưu lại toàn bộ thông tin được khoanh đỏ bên trên.
Bước 6: Faucet in discord
!faucet xxxx
Trong đó, “xxxx” là địa chỉ ví anh em đã tạo ở bước trên.
Bước 7: Download the source code
git clone https://github.com/MystenLabs/sui.git ‐‐branch testnet
Bước 8: Config your node
cd sui
Tiếp theo,
git remote add upstream https://github.com/MystenLabs/sui
Sync your fork:
git fetch upstream
Make a copy of the full node configuration template:
cp crates/sui-config/data/fullnode-template.yaml fullnode.yaml
Download the lastest genesis state for devnet:
curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/testnet/genesis.blob
Tiếp theo,
screen -S sui
Cuối cùng,
cargo run ‐‐release ‐‐bin sui-node ‐‐ ‐‐config-path fullnode.yaml
Bước 9: Finish
Check Sui node tại đây.
Dán IP node của anh em vào vùng mình khoanh đỏ. Nếu node active thì sẽ có thông tin như hình bên dưới nhé!
Bước 10: Start Sync
Bước 10.1:
killall screen
cd $HOME
rm -rf .sui
mkdir .sui
Bước 10.2:
mv $HOME/.cargo/bin/sui-node /usr/local/bin/
Buớc 10.3:
wget -O $HOME/.sui/genesis.blob https://github.com/MystenLabs/sui-genesis/raw/main/testnet/genesis.blob
Tiếp theo:
cp $HOME/sui/crates/sui-config/data/fullnode-template.yaml $HOME/.sui/fullnode.yaml
Tiếp theo:
sed -i.bak "s|db-path:.*|db-path: \"$HOME\/.sui\/db\"| ; s|genesis-file-location:.*|genesis-file-location: \"$HOME\/.sui\/genesis.blob\"| ; s|127.0.0.1|0.0.0.0|” $HOME/.sui/fullnode.yaml
Bước 10.4:
sudo tee -a $HOME/.sui/fullnode.yaml >/dev/null <<EOF
p2p-config:
seed-peers:
– address: "/ip4/65.109.32.171/udp/8084"
– address: "/ip4/65.108.44.149/udp/8084"
– address: "/ip4/95.214.54.28/udp/8080"
– address: "/ip4/136.243.40.38/udp/8080"
– address: "/ip4/84.46.255.11/udp/8084"
– address: "/ip4/135.181.6.243/udp/8088"
– address: "/ip4/89.163.132.44/udp/8080"
EOF
Bước 10.5:
echo "[Unit]
Description=Sui Node
After=network.target
[Service]
User=$USER
Type=simple
ExecStart=/usr/local/bin/sui-node ‐&hyphenconfig-path $HOME/.sui/fullnode.yaml
Restart=on-failure
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target" > $HOME/suid.service
Tiếp theo:
mv $HOME/suid.service /etc/systemd/system/
Kết thúc:
sudo systemctl restart systemd-journald
sudo systemctl daemon-reload
sudo systemctl enable suid
sudo systemctl restart suid
journalctl -u suid -f
Check node đã Sync hay chưa:
https://www.scale3labs.com/check/sui
Lưu ý: chọn Network là Testnet
Hiển thị như thế này là bạn đã thành công
Lời kết
Trên đây là toàn bộ hướng dẫn chạy testnet Wave 2 của Sui, nếu có thắc mắc anh em có thể để lại comment bên dưới hoặc tham gia nhóm telegram của team mình để được giải đáp nhanh nhất nhé. Xin chào và hẹn gặp lại anh em ở những bài viết sau!
Disclaimer: Giao dịch tiền điện tử có mức độ rủi ro cao và có thể không phù hợp với tất cả các nhà đầu tư. CryptoViet sẽ không chịu trách nhiệm pháp lý đối với bất kỳ tổn thất hoặc thiệt hại nào có thể phát sinh trực tiếp hoặc gián tiếp từ việc sử dụng hoặc phụ thuộc vào những thông tin trên. Tất cả các ý kiến được bày tỏ trên trang web này thuộc sở hữu của người viết và không bao giờ được coi là lời khuyên dưới bất kỳ hình thức nào.
Trả lời