Solana 主網 RPC - 快速入門
簡介
要部署 Solana 主網 RPC,您需要使用 SLV 命令列工具。
本快速入門指南介紹如何使用 SLV 命令列工具部署帶有 Geyser Yellowstone 外掛的 Solana 主網 RPC。
您的伺服器必須全新安裝 Ubuntu 24.04 LTS。
準備裸金屬伺服器
雖然可以在 VPS 或虛擬機器(VM)上執行 Solana 客戶端,但要實現最佳效能和穩定執行是很有挑戰性的。RPC 節點和驗證者在高負載條件下執行,因此設定適當的伺服器環境至關重要。
Solana 官方推薦使用裸金屬伺服器。
RPC 節點的配置因工作負載而異。
標準 RPC(SendTx / Geyser gRPC)和索引 RPC(全索引)在記憶體和儲存需求方面有顯著差異。
RPC 硬體要求(參考指南)
| 元件 | RPC 節點 | 索引 RPC(參考) |
|---|---|---|
| CPU | 24 核以上 @ 2.8GHz 以上 / AMD Gen3 以上 / Intel Ice Lake 以上 / SHA 擴充套件 / AVX2 | 32 核以上(推薦高主頻) |
| 記憶體 | 512GB 以上 | 1152GB 以上 |
| 磁碟 | NVMe Gen3 x4 或更好 / 建議分離賬戶/賬本/快照 | 更大容量 + 高 TBW / 建議分離 |
| 網路 | 1Gbps 或更高 | 1Gbps 或更高(頻寬越大越好) |
| GPU | 不需要 | 不需要 |
注意: 時脈頻率和有效吞吐量被認為比核心數更重要。 索引 RPC 可能受到記憶體和儲存的瓶頸限制,因此請確保有足夠的容量和高 IOPS。
如果需要索引功能,建議 768GB 以上,穩定執行建議 1152GB 以上。
SLV Metal 提供在您預算範圍內實現最高效能的裸金屬伺服器。
執行
slv metal list 命令時,您可以找到專為 Solana RPC 節點定製的 RPC 選項。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 Node如果您尚未設定裸金屬伺服器,請參閱裸金屬伺服器設定指南。
此外,請參考以下資源:
部署 Solana RPC 節點
首先,初始化 Solana RPC 配置。
請選擇您所需的 Solana 網路。
bash
slv rpc init
? Select Solana Network (mainnet)
testnet
devnet
❯ mainnetslv rpc init
? Select Solana Network (mainnet)
testnet
devnet
❯ mainnet接下來,確認您是否擁有 Solana 節點相容伺服器。
bash
? 🛡️ Do you have a Solana Node Compatible Server? (yes)
❯ yes
no? 🛡️ Do you have a Solana Node Compatible Server? (yes)
❯ yes
no本教程假設您選擇
yes。設定伺服器使用者和 IP 地址
設定伺服器使用者、IP 地址和 RSA 金鑰路徑。
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)自動區域檢測
接下來,系統將從您配置的節點 ping 每個區塊引擎,以自動檢測最近的區域。透過測量實際 ping 值,您可以選擇最優區域。
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.wtf生成身份金鑰對
如果您沒有身份金鑰對,可以生成一個新的。
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.json選擇 Solana CLI
選擇 Solana CLI 版本。
bash
? Select Solana CLI (jito)
agave
❯ jito
firedancer-agave
firedancer-jito? Select Solana CLI (jito)
agave
❯ jito
firedancer-agave
firedancer-jito選擇 RPC 型別
選擇 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 + gRPC在本教程中,我們選擇
Geyser gRPC。確認配置
最後,確認配置。
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 p3tnYqjciWz8DnjApUVDPWTEhdzdX6qvqTaRCrckSLV之後,
solv 使用者將在裸金屬伺服器上建立,
Solana RPC 配置將儲存到 ~/.slv/inventory.mainnet.rpcs.yml。部署 Solana RPC 節點
確認配置後,部署將開始。
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 m完成!您的 Solana RPC 節點現已部署。
與 Solana 網路同步需要一些時間。
除錯和監控
部署後,您可以使用以下命令檢查 Solana RPC 節點的狀態:
bash
ssh solv@<your-server-ip>
solv mssh solv@<your-server-ip>
solv msolv 是 agave-validator -l /mnt/ledger 的別名。
此設定在 RPC 節點部署過程中新增到 ~/.profile。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