Solana Testnet Validator - Bắt đầu nhanh
Cài đặt & Khởi chạy Validator
bash
curl -fsSL https://storage.slv.dev/slv/install | sh
slv validator init
slv validator deploycurl -fsSL https://storage.slv.dev/slv/install | sh
slv validator init
slv validator deployTriển khai Solana Testnet Firedancer Validator
🚀 Điều kiện tiên quyết
Vui lòng chuẩn bị máy chủ đã cài đặt sạch Ubuntu 24.04 LTS.
🔑 Về xử lý Key
Đối với các triển khai SLV Firedancer mới, unstaked-keypair.json luôn được sử dụng làm identity key ban đầu vì lý do bảo mật.
Đây là best practice để ngăn các vấn đề nghiêm trọng như double voting.
✅ Thiết lập Identity sau triển khai
Sau khi triển khai, hãy đảm bảo thiết lập identity key được ủy quyền bằng lệnh sau:
bash
slv v set:identity -n testnet --pubkey <tên>slv v set:identity -n testnet --pubkey <tên>Chuẩn bị máy chủ Baremetal cho Testnet
Mặc dù có thể chạy Solana node trên VPS hoặc máy ảo (VM), việc đạt hiệu suất tối ưu và ổn định là thách thức trên thực tế. Solana chính thức khuyến nghị sử dụng máy chủ baremetal, mang lại hiệu suất cao hơn nhiều so với môi trường ảo hóa.
Vì môi trường testnet có tải thấp hơn so với mainnet, chúng tôi đã xác nhận vận hành ổn định sử dụng máy chủ với CPU Ryzen 16 core và 128GB DDR5 RAM. Sử dụng cấu hình máy chủ này giúp giảm chi phí vận hành, vì vậy nó được khuyến nghị.
Khi bạn chạy lệnh
slv v init, bạn sẽ được hỏi liệu máy chủ baremetal đã sẵn sàng chưa:bash
➜ slv v init
? Select Solana Network (testnet) › testnet
? 🛡️ Do you have a Solana Node Compatible Server? (no)
❯ yes
no➜ slv v init
? Select Solana Network (testnet) › testnet
? 🛡️ Do you have a Solana Node Compatible Server? (no)
❯ yes
noHướng dẫn này giả sử bạn chọn
yes.Nếu bạn chưa chuẩn bị máy chủ baremetal, vui lòng tham khảo Hướng dẫn thiết lập Baremetal Server để hoàn tất thiết lập.
Nhập username mặc định của máy chủ
Thông thường, username mặc định là
ubuntu hoặc root.bash
? What's the user for the server? (ubuntu) › ubuntu? What's the user for the server? (ubuntu) › ubuntuNhập địa chỉ IP máy chủ
Nhập địa chỉ IP của máy chủ.
bash
? What's the IP address of the server? ›? What's the IP address of the server? ›Thiết lập RSA Key cho SSH
※ Vui lòng thiết lập đường dẫn đến RSA key. Đường dẫn mặc định là
~/.ssh/id_rsa.
Hiện tại, chỉ đường dẫn mặc định được hỗ trợ, vì vậy vui lòng giữ nguyên.bash
? What's the path to your RSA key? (~/.ssh/id_rsa) › ~/.ssh/id_rsa
🔍 Checking SSH connection...
✔︎ SSH connection succeeded? What's the path to your RSA key? (~/.ssh/id_rsa) › ~/.ssh/id_rsa
🔍 Checking SSH connection...
✔︎ SSH connection succeededSau đó SLV sẽ kiểm tra kết nối đến máy chủ. Nếu kết nối thành công, bước tiếp theo sẽ được hiển thị.
Chọn loại Solana Validator
Chọn loại Solana validator.
bash
? Select Validator Type (firedancer-jito)
agave
jito
jito-bam
firedancer-agave
❯ firedancer-jito? Select Validator Type (firedancer-jito)
agave
jito
jito-bam
firedancer-agave
❯ firedancer-jitoTạo hoặc thiết lập Solana Validator Identity Key
Bạn có thể tạo identity key mới hoặc thiết lập identity key hiện có.
Ví dụ này cho thấy cách thiết lập identity key hiện có với tên "epics-test".
bash
? Do you want to create a new identity key now? (Y/n) › No
? Please Enter Your Identity Public Key › TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp
? Enter Inventory Name (TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp) › epics-test
⚠️ Please place your identity key in
~/.slv/keys/TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp.json
.
.
✔︎ Success
✔ Inventory updated to ~/.slv/inventory.yml
✔ Successfully created solv user on x.x.x.x? Do you want to create a new identity key now? (Y/n) › No
? Please Enter Your Identity Public Key › TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp
? Enter Inventory Name (TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp) › epics-test
⚠️ Please place your identity key in
~/.slv/keys/TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp.json
.
.
✔︎ Success
✔ Inventory updated to ~/.slv/inventory.yml
✔ Successfully created solv user on x.x.x.xVui lòng đặt identity key tại
~/.slv/keys/<your-pubkey>.json. Sau đó, SLV sẽ tạo user solv bằng mật khẩu.Phát hiện khu vực tự động
Tiếp theo, hệ thống sẽ ping từng block engine từ node đã cấu hình để tự động phát hiện khu vực gần nhất.
bash
📍 Measuring latencies from x.x.x.x to testnet regions...
Pinging Dallas (dallas.testnet.block-engine.jito.wtf)...
Pinging New York (ny.testnet.block-engine.jito.wtf)...
✅ New York: 74.341 ms
✅ Dallas: 114.722 ms
🎯 Nearest region: 🇺🇸 New York
Latency: 74.341 ms
Block Engine: https://ny.testnet.block-engine.jito.wtf
Shred Receiver: 64.130.35.224:1002
Relayer: http://ny.testnet.relayer.jito.wtf:8100
NTP Server: ntp.dallas.jito.wtf📍 Measuring latencies from x.x.x.x to testnet regions...
Pinging Dallas (dallas.testnet.block-engine.jito.wtf)...
Pinging New York (ny.testnet.block-engine.jito.wtf)...
✅ New York: 74.341 ms
✅ Dallas: 114.722 ms
🎯 Nearest region: 🇺🇸 New York
Latency: 74.341 ms
Block Engine: https://ny.testnet.block-engine.jito.wtf
Shred Receiver: 64.130.35.224:1002
Relayer: http://ny.testnet.relayer.jito.wtf:8100
NTP Server: ntp.dallas.jito.wtfTạo hoặc thiết lập Solana Validator Vote Account Key
Bạn có thể tạo vote account key mới hoặc thiết lập vote account key hiện có.
bash
? Do you want to create a new vote account key now? (Y/n) › No
? Please Enter Your Vote Account Public Key > <your-vote-account>? Do you want to create a new vote account key now? (Y/n) › No
? Please Enter Your Vote Account Public Key > <your-vote-account>Cấu hình đã được lưu vào
~/.slv/inventory.testnet.validators.yml.Triển khai Validator
Sau khi xác nhận cấu hình, quá trình triển khai sẽ bắt đầu.
bash
slv v deploy -n testnetslv v deploy -n testnetĐầu tiên, xác nhận cấu hình sẽ được hiển thị.
Chọn Yes để tiếp tục.
bash
Your Testnet Validators Settings:
┌────────────────┬──────────────────────────────────────────────┐
│ Identity Key │ TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp │
├────────────────┼──────────────────────────────────────────────┤
│ Vote Key │ 6XdQ6szHJjm1t3XbgahSS6WVEhsrs5fniZbLgfkN1QWn │
├────────────────┼──────────────────────────────────────────────┤
│ Authority Key │ authAccount │
├────────────────┼──────────────────────────────────────────────┤
│ IP │ x.x.x.x. │
├────────────────┼──────────────────────────────────────────────┤
│ Validator Type │ jito │
├────────────────┼──────────────────────────────────────────────┤
│ Version │ 3.0.7-jito │
└────────────────┴──────────────────────────────────────────────┘
? Do you want to continue? (Y/n) › YesYour Testnet Validators Settings:
┌────────────────┬──────────────────────────────────────────────┐
│ Identity Key │ TKMNqvfwb7PKkc9KFEJJ8EaNK9s5XjNWgFS6oyqSLkp │
├────────────────┼──────────────────────────────────────────────┤
│ Vote Key │ 6XdQ6szHJjm1t3XbgahSS6WVEhsrs5fniZbLgfkN1QWn │
├────────────────┼──────────────────────────────────────────────┤
│ Authority Key │ authAccount │
├────────────────┼──────────────────────────────────────────────┤
│ IP │ x.x.x.x. │
├────────────────┼──────────────────────────────────────────────┤
│ Validator Type │ jito │
├────────────────┼──────────────────────────────────────────────┤
│ Version │ 3.0.7-jito │
└────────────────┴──────────────────────────────────────────────┘
? Do you want to continue? (Y/n) › YesHoàn tất! Solana Validator của bạn đã được triển khai. Sẽ mất một thời gian để đồng bộ với mạng Solana.
Gỡ lỗi & Giám sát
Sau khi triển khai, bạn có thể gỡ lỗi và giám sát trong Solana RPC node.
bash
$ solv m$ solv msolv là alias cho agave-validator -l /mnt/ledger.
Thiết lập này được thêm vào ~/.profile trong quá trình triển khai RPC node.Thay đổi Identity Key
Sau khi triển khai, bạn cần thay đổi unstaked key sang identity key được ủy quyền.
bash
slv v set:identity -n testnet --pubkey epics-testslv v set:identity -n testnet --pubkey epics-testLệnh này sẽ thiết lập identity key từ máy tính cục bộ tại:
~/.slv/keys/<name>.jsonKhởi động lại Firedancer
Nếu bạn gặp vấn đề với validator, bạn có thể khởi động lại firedancer bằng lệnh sau.
Tùy chọn
--rm sẽ dừng validator, xóa thư mục ledger và snapshot, tải snapshot sử dụng snapshot finder, và sau đó khởi động validator.bash
slv v restart -n testnet --pubkey <tên> --rmslv v restart -n testnet --pubkey <tên> --rmCác lệnh SLV Validator
bash
slv validator --help
Usage: slv validator
Version: 0.9.700
Description:
🛠️ Manage Solana Validator Nodes 🛠️
Options:
-h, --help - Show this help.
Commands:
init - 🚀 Initialize a new validator configuration
deploy - 📦 Deploy Validators
list - 📋 List validators
set:identity - 🪪 Set Validator Identity
set:unstaked - 📴 Set Validator Identity to Unstaked Key
setup:firedancer - 🔥 Setup/Update Firedancer Validator
update:firedancer - 🔄 Update Firedancer Version
build:solana-cli - 🛠️ Build Solana CLI from Source
install:solana - ➡️ Install Solana CLI Binary
update:script - ⚙️ Update Validator Startup Config
update:jinja - 🧩 Update Jinja Template
start - 🟢 Start Validator
stop - 🔴 Stop Validator
restart - ♻️ Restart Validator
cleanup - 🧹 Cleanup Validator - Remove Ledger/Snapshot Unnecessary Files
get:snapshot - 💾 Download Snapshot with aria2c
gen:vote-account - 🗳️ Generate Vote Account
switch - 🔁 Switch Validator Identity - No DownTime Migrationslv validator --help
Usage: slv validator
Version: 0.9.700
Description:
🛠️ Manage Solana Validator Nodes 🛠️
Options:
-h, --help - Show this help.
Commands:
init - 🚀 Initialize a new validator configuration
deploy - 📦 Deploy Validators
list - 📋 List validators
set:identity - 🪪 Set Validator Identity
set:unstaked - 📴 Set Validator Identity to Unstaked Key
setup:firedancer - 🔥 Setup/Update Firedancer Validator
update:firedancer - 🔄 Update Firedancer Version
build:solana-cli - 🛠️ Build Solana CLI from Source
install:solana - ➡️ Install Solana CLI Binary
update:script - ⚙️ Update Validator Startup Config
update:jinja - 🧩 Update Jinja Template
start - 🟢 Start Validator
stop - 🔴 Stop Validator
restart - ♻️ Restart Validator
cleanup - 🧹 Cleanup Validator - Remove Ledger/Snapshot Unnecessary Files
get:snapshot - 💾 Download Snapshot with aria2c
gen:vote-account - 🗳️ Generate Vote Account
switch - 🔁 Switch Validator Identity - No DownTime Migration