Solana Mainnet RPC - Bắt đầu nhanh
Giới thiệu
Để triển khai Solana mainnet RPC, bạn sẽ sử dụng công cụ dòng lệnh SLV.
Hướng dẫn bắt đầu nhanh này giải thích cách sử dụng SLV CLI để triển khai Solana mainnet RPC với plugin Geyser Yellowstone.
Bạn phải cài đặt sạch Ubuntu 24.04 LTS trên máy chủ.
Chuẩn bị máy chủ Baremetal
Mặc dù có thể chạy Solana client trên VPS hoặc máy ảo (VM), việc đạt hiệu suất tối ưu và vận hành ổn định là thách thức. Các RPC node và validator, đặc biệt, hoạt động trong điều kiện tải cao, khiến việc thiết lập môi trường máy chủ phù hợp trở nên quan trọng.
Solana chính thức khuyến nghị sử dụng máy chủ baremetal.
RPC node thay đổi rất nhiều tùy thuộc vào workload.
RPC tiêu chuẩn (SendTx / Geyser gRPC) và Index RPC (full indexing) khác nhau đáng kể, đặc biệt về yêu cầu bộ nhớ và lưu trữ.
Yêu cầu phần cứng RPC (hướng dẫn)
| Thành phần | RPC Node | Index RPC (tham khảo) |
|---|---|---|
| CPU | 24 core+ @ 2.8GHz+ / AMD Gen3+ / Intel Ice Lake+ / SHA extensions / AVX2 | 32 core+ (khuyến nghị xung nhịp cao) |
| RAM | 512GB+ | 1152GB+ |
| Ổ đĩa | NVMe Gen3 x4 trở lên / Khuyến nghị tách Accounts / Ledger / Snapshots | Dung lượng lớn hơn + TBW cao / khuyến nghị tách riêng |
| Mạng | 1Gbps trở lên | 1Gbps trở lên (băng thông cao hơn là tốt hơn) |
| GPU | Không cần thiết | Không cần thiết |
Lưu ý: Xung nhịp và thông lượng hiệu quả được coi là quan trọng hơn số lượng core. Index RPC có thể bị nghẽn bởi bộ nhớ và lưu trữ, vì vậy đảm bảo đủ dung lượng và IOPS cao.
Nếu cần indexing, chúng tôi khuyến nghị 768GB trở lên, và 1152GB trở lên cho vận hành ổn định.
SLV Metal cung cấp máy chủ baremetal được thiết kế để mang lại hiệu suất cao nhất trong ngân sách của bạn.
Khi thực thi lệnh
slv metal list, bạn có thể tìm thấy tùy chọn RPC được thiết kế riêng cho Solana RPC node.bash
slv metal list
? 🛡️ Select SLV BareMetal Type (APP)
📦 APP - For Trade Bot,Testnet Validator, DApp and More!
🚀 MV - For Solana Mainnet Validator
❯ 🛡️⚡️ RPC - For Solana RPC Nodeslv metal list
? 🛡️ Select SLV BareMetal Type (APP)
📦 APP - For Trade Bot,Testnet Validator, DApp and More!
🚀 MV - For Solana Mainnet Validator
❯ 🛡️⚡️ RPC - For Solana RPC NodeNếu bạn chưa thiết lập máy chủ baremetal, vui lòng tham khảo Hướng dẫn thiết lập Baremetal Server.
Ngoài ra, tham khảo các tài nguyên sau:
Triển khai Solana RPC Node
Đầu tiên, khởi tạo cấu hình Solana RPC.
Vui lòng chọn network là mạng Solana mong muốn.
bash
slv rpc init
? Select Solana Network (mainnet)
testnet
devnet
❯ mainnetslv rpc init
? Select Solana Network (mainnet)
testnet
devnet
❯ mainnetTiếp theo, xác nhận liệu bạn đã có máy chủ tương thích Solana Node chưa.
bash
? 🛡️ Do you have a Solana Node Compatible Server? (yes)
❯ yes
no? 🛡️ Do you have a Solana Node Compatible Server? (yes)
❯ yes
noHướng dẫn này giả sử bạn chọn
yes.Thiết lập User và địa chỉ IP máy chủ
Thiết lập user máy chủ, địa chỉ IP và đường dẫn RSA key.
bash
? What's the user for the server? (root) › root
? Enter the server IP address › x.x.x.x
? What's the path to your RSA key? (~/.ssh/id_rsa)? What's the user for the server? (root) › root
? Enter the server IP address › x.x.x.x
? What's the path to your RSA key? (~/.ssh/id_rsa)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. Bằng cách đo giá trị ping thực tế, bạn có thể chọn khu vực tối ưu.
bash
🔍 Checking SSH connection...
✔︎ SSH connection succeeded
📍 Measuring latencies from x.x.x.x to mainnet regions...
Pinging Amsterdam (amsterdam.mainnet.block-engine.jito.wtf)...
Pinging Dublin (dublin.mainnet.block-engine.jito.wtf)...
Pinging Frankfurt (frankfurt.mainnet.block-engine.jito.wtf)...
Pinging London (london.mainnet.block-engine.jito.wtf)...
Pinging New York (ny.mainnet.block-engine.jito.wtf)...
Pinging Salt Lake City (slc.mainnet.block-engine.jito.wtf)...
Pinging Singapore (singapore.mainnet.block-engine.jito.wtf)...
Pinging Tokyo (tokyo.mainnet.block-engine.jito.wtf)...
✅ Singapore: 0.291 ms
✅ London: 154.071 ms
✅ Dublin: 167.267 ms
✅ Frankfurt: 149.081 ms
✅ Amsterdam: 154.501 ms
✅ New York: 228.624 ms
✅ Salt Lake City: 278.016 ms
✅ Tokyo: 376.816 ms
🎯 Nearest region: 🇸🇬 Singapore
Latency: 0.291 ms
Block Engine: https://singapore.mainnet.block-engine.jito.wtf
Shred Receiver: 202.8.11.224:1002
Relayer: http://singapore.mainnet.relayer.jito.wtf:8100
NTP Server: ntp.singapore.jito.wtf🔍 Checking SSH connection...
✔︎ SSH connection succeeded
📍 Measuring latencies from x.x.x.x to mainnet regions...
Pinging Amsterdam (amsterdam.mainnet.block-engine.jito.wtf)...
Pinging Dublin (dublin.mainnet.block-engine.jito.wtf)...
Pinging Frankfurt (frankfurt.mainnet.block-engine.jito.wtf)...
Pinging London (london.mainnet.block-engine.jito.wtf)...
Pinging New York (ny.mainnet.block-engine.jito.wtf)...
Pinging Salt Lake City (slc.mainnet.block-engine.jito.wtf)...
Pinging Singapore (singapore.mainnet.block-engine.jito.wtf)...
Pinging Tokyo (tokyo.mainnet.block-engine.jito.wtf)...
✅ Singapore: 0.291 ms
✅ London: 154.071 ms
✅ Dublin: 167.267 ms
✅ Frankfurt: 149.081 ms
✅ Amsterdam: 154.501 ms
✅ New York: 228.624 ms
✅ Salt Lake City: 278.016 ms
✅ Tokyo: 376.816 ms
🎯 Nearest region: 🇸🇬 Singapore
Latency: 0.291 ms
Block Engine: https://singapore.mainnet.block-engine.jito.wtf
Shred Receiver: 202.8.11.224:1002
Relayer: http://singapore.mainnet.relayer.jito.wtf:8100
NTP Server: ntp.singapore.jito.wtfTạo Identity Keypair
Nếu bạn chưa có identity keypair, bạn có thể tạo mới.
bash
? Do you want to create a new identity key now? (Y/n) › Yes
🔑 Generating new identity key...
✨ Generated Key: p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV
✨ Moved Key to: ~/.slv/keys/p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV.json? Do you want to create a new identity key now? (Y/n) › Yes
🔑 Generating new identity key...
✨ Generated Key: p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV
✨ Moved Key to: ~/.slv/keys/p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV.jsonChọn Solana CLI
Chọn phiên bản Solana CLI.
bash
? Select Solana CLI (jito)
agave
❯ jito
firedancer-agave
firedancer-jito? Select Solana CLI (jito)
agave
❯ jito
firedancer-agave
firedancer-jitoChọn loại RPC
Chọn loại RPC.
bash
? Select an RPC type
❯ Geyser gRPC
Index RPC
SendTx RPC
Index RPC + gRPC? Select an RPC type
❯ Geyser gRPC
Index RPC
SendTx RPC
Index RPC + gRPCTrong hướng dẫn này, chúng ta chọn
Geyser gRPC.Xác nhận cấu hình
Cuối cùng, xác nhận cấu hình.
bash
✔︎ Success
✔ Inventory updated to ~/.slv/inventory.mainnet.rpcs.yml
✔ Successfully created solv user on p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV
✔︎ mainnet_rpcs inventory file has been saved to ~/.slv/inventory.mainnet.rpcs.yml
Now you can deploy with:
$ slv rpc deploy -n mainnet -p p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV✔︎ Success
✔ Inventory updated to ~/.slv/inventory.mainnet.rpcs.yml
✔ Successfully created solv user on p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV
✔︎ mainnet_rpcs inventory file has been saved to ~/.slv/inventory.mainnet.rpcs.yml
Now you can deploy with:
$ slv rpc deploy -n mainnet -p p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLVSau đó, user
solv được tạo trên máy chủ bare metal, và
cấu hình Solana RPC được lưu vào ~/.slv/inventory.mainnet.rpcs.yml.Triển khai Solana RPC Node
Sau khi xác nhận cấu hình, quá trình triển khai sẽ bắt đầu.
bash
slv rpc deploy -n mainnet -p p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLVslv rpc deploy -n mainnet -p p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLVbash
Your mainnet RPC Nodes Settings:
┌──────────────┬─────────────────────────────────────────────┐
│ Identity Key │ p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV │
├──────────────┼─────────────────────────────────────────────┤
│ Name │ p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV │
├──────────────┼─────────────────────────────────────────────┤
│ IP │ x.x.x.x. │
├──────────────┼─────────────────────────────────────────────┤
│ Region │ singapore │
├──────────────┼─────────────────────────────────────────────┤
│ RPC Type │ Geyser gRPC │
├──────────────┼─────────────────────────────────────────────┤
│ Version │ 3.0.7-jito │
└──────────────┴─────────────────────────────────────────────┘
.
.
.
Successfully Deployed RPC on mainnet
⚡️⚡️⚡️ Enhanced Solana RPC Connection API Key ⚡️⚡️⚡️
We're excited to offer a free API key exclusively for the Validators DAO community 🎉
It's our way of supporting the community and empowering you with fast, reliable connections.
To get your Free API key, simply join us through the link below:
Validators DAO: `https://discord.gg/X4BgkBHavp`
Unlock fast connections and elevate your experience with your very own API key 🚀
You can monitor your Node with the following steps:
Log in to your server with SSH:
ssh [email protected]
Then, run the following command to monitor your node:
$ solv mYour mainnet RPC Nodes Settings:
┌──────────────┬─────────────────────────────────────────────┐
│ Identity Key │ p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV │
├──────────────┼─────────────────────────────────────────────┤
│ Name │ p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV │
├──────────────┼─────────────────────────────────────────────┤
│ IP │ x.x.x.x. │
├──────────────┼─────────────────────────────────────────────┤
│ Region │ singapore │
├──────────────┼─────────────────────────────────────────────┤
│ RPC Type │ Geyser gRPC │
├──────────────┼─────────────────────────────────────────────┤
│ Version │ 3.0.7-jito │
└──────────────┴─────────────────────────────────────────────┘
.
.
.
Successfully Deployed RPC on mainnet
⚡️⚡️⚡️ Enhanced Solana RPC Connection API Key ⚡️⚡️⚡️
We're excited to offer a free API key exclusively for the Validators DAO community 🎉
It's our way of supporting the community and empowering you with fast, reliable connections.
To get your Free API key, simply join us through the link below:
Validators DAO: `https://discord.gg/X4BgkBHavp`
Unlock fast connections and elevate your experience with your very own API key 🚀
You can monitor your Node with the following steps:
Log in to your server with SSH:
ssh [email protected]
Then, run the following command to monitor your node:
$ solv mHoàn tất! Solana RPC node 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ể kiểm tra trạng thái Solana RPC node bằng lệnh sau:
bash
ssh solv@<ip-máy-chủ-của-bạn>
solv mssh solv@<ip-máy-chủ-của-bạn>
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.Các lệnh SLV RPC
bash
Usage: slv rpc
Version: 0.9.700
Description:
🛠️ Manage Solana RPC Nodes 🛠️
Options:
-h, --help - Show this help.
Commands:
init - 🚀 Initialize a new RPC node configuration
deploy - 📦 Deploy RPC Nodes
list - 📋 List RPC Nodes
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 RPC Startup Config
update:geyser - ⚡️ Update Geyser Version
start - 🟢 Start RPC
stop - 🔴 Stop RPC
restart - ♻️ Restart RPC
cleanup - 🧹 Cleanup RPC - Remove Ledger/Snapshot Unnecessary Files
get:snapshot - 💾 Download Snapshot with aria2c
update:allowed-ips - 🛡️ Update allowed IPs for mainnet RPC nodesUsage: slv rpc
Version: 0.9.700
Description:
🛠️ Manage Solana RPC Nodes 🛠️
Options:
-h, --help - Show this help.
Commands:
init - 🚀 Initialize a new RPC node configuration
deploy - 📦 Deploy RPC Nodes
list - 📋 List RPC Nodes
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 RPC Startup Config
update:geyser - ⚡️ Update Geyser Version
start - 🟢 Start RPC
stop - 🔴 Stop RPC
restart - ♻️ Restart RPC
cleanup - 🧹 Cleanup RPC - Remove Ledger/Snapshot Unnecessary Files
get:snapshot - 💾 Download Snapshot with aria2c
update:allowed-ips - 🛡️ Update allowed IPs for mainnet RPC nodes