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