Leader Slot 信息 API 文档
什么是 Leader Slot 信息(getLeaderSlots)API?
getLeaderSlots 是一个扩展的 Solana RPC 方法,用于从网络中检索 Leader 验证者调度信息。
如果您持有 ERPC 使用积分(API 代币),可以使用与标准 Solana RPC 调用相同的格式来调用它。此 API 提供以下信息:
- 从指定 slot 开始的 Leader 验证者调度
- 每个 Leader 的估计区域和地理位置
- 参考 ping 测量值(
pingToLeaders)
端点和请求体示例
text
https://edge.erpc.global?api-key=<YOUR_API_KEY>https://edge.erpc.global?api-key=<YOUR_API_KEY>在
params 中指定起始 slot 编号。json
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLeaderSlots",
"params": [368488568]
}{
"jsonrpc": "2.0",
"id": 1,
"method": "getLeaderSlots",
"params": [368488568]
}示例(HTTP)
bash
curl https://edge.erpc.global?api-key=<YOUR_API_KEY> \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"id":1,
"method":"getLeaderSlots",
"params":[368488568]
}'curl https://edge.erpc.global?api-key=<YOUR_API_KEY> \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0",
"id":1,
"method":"getLeaderSlots",
"params":[368488568]
}'响应示例(JSON)
json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"identity": "DTSUKYHde29PHLy2fBLarsbDdPHQuhZmvjRVuJ2QRC8",
"epoch": 852,
"slot": 368488631,
"ipAddress": "198.73.56.215",
"gossipPort": 8000,
"tpuPort": 8003,
"tpuQuicPort": 8009,
"rpcAddress": null,
"version": "0.708.20306",
"featureSet": "3640012085",
"pingToLeaders": [
{
"city": "Amsterdam",
"region": "North Holland",
"ms": 7.687,
"fromIp": "185.191.118.11",
"country": "NL",
"lat": 52.374,
"lon": 4.8897,
"org": "AS5552 Serverside.com",
"postal": "1012",
"timezone": "Europe/Amsterdam"
}
]
},
{
"identity": "HyperSPG8w4jgdHgmA8ExrhRLL1LBRirRTHDU9FdXJUud",
"epoch": 852,
"slot": 368488632,
"ipAddress": "216.238.85.198",
"gossipPort": 8001,
"tpuPort": 9001,
"tpuQuicPort": 9007,
"rpcAddress": null,
"version": "0.708.20306",
"featureSet": "3640012085",
"pingToLeaders": [
{
"city": "General Lázaro Cárdenas",
"region": "Querétaro",
"ms": 136.96,
"fromIp": "185.191.118.11",
"country": "MX",
"lat": 20.5619,
"lon": -100.2449,
"org": "AS42473 The Constant Company, LLC",
"postal": "76264",
"timezone": "America/Mexico_City"
}
]
},
{
"identity": "HyperSPG8w4jgdHgmA8ExrhRLL1LBRirRTHDU9FdXJUud",
"epoch": 852,
"slot": 368488633,
"ipAddress": "216.238.85.198",
"gossipPort": 8001,
"tpuPort": 9001,
"tpuQuicPort": 9007,
"rpcAddress": null,
"version": "0.708.20306",
"featureSet": "3640012085",
"pingToLeaders": [
{
"city": "General Lázaro Cárdenas",
"region": "Querétaro",
"ms": 136.92,
"fromIp": "185.191.118.11",
"country": "MX",
"lat": 20.5619,
"lon": -100.2449,
"org": "AS42473 The Constant Company, LLC",
"postal": "76264",
"timezone": "America/Mexico_City"
}
]
}
]
}{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"identity": "DTSUKYHde29PHLy2fBLarsbDdPHQuhZmvjRVuJ2QRC8",
"epoch": 852,
"slot": 368488631,
"ipAddress": "198.73.56.215",
"gossipPort": 8000,
"tpuPort": 8003,
"tpuQuicPort": 8009,
"rpcAddress": null,
"version": "0.708.20306",
"featureSet": "3640012085",
"pingToLeaders": [
{
"city": "Amsterdam",
"region": "North Holland",
"ms": 7.687,
"fromIp": "185.191.118.11",
"country": "NL",
"lat": 52.374,
"lon": 4.8897,
"org": "AS5552 Serverside.com",
"postal": "1012",
"timezone": "Europe/Amsterdam"
}
]
},
{
"identity": "HyperSPG8w4jgdHgmA8ExrhRLL1LBRirRTHDU9FdXJUud",
"epoch": 852,
"slot": 368488632,
"ipAddress": "216.238.85.198",
"gossipPort": 8001,
"tpuPort": 9001,
"tpuQuicPort": 9007,
"rpcAddress": null,
"version": "0.708.20306",
"featureSet": "3640012085",
"pingToLeaders": [
{
"city": "General Lázaro Cárdenas",
"region": "Querétaro",
"ms": 136.96,
"fromIp": "185.191.118.11",
"country": "MX",
"lat": 20.5619,
"lon": -100.2449,
"org": "AS42473 The Constant Company, LLC",
"postal": "76264",
"timezone": "America/Mexico_City"
}
]
},
{
"identity": "HyperSPG8w4jgdHgmA8ExrhRLL1LBRirRTHDU9FdXJUud",
"epoch": 852,
"slot": 368488633,
"ipAddress": "216.238.85.198",
"gossipPort": 8001,
"tpuPort": 9001,
"tpuQuicPort": 9007,
"rpcAddress": null,
"version": "0.708.20306",
"featureSet": "3640012085",
"pingToLeaders": [
{
"city": "General Lázaro Cárdenas",
"region": "Querétaro",
"ms": 136.92,
"fromIp": "185.191.118.11",
"country": "MX",
"lat": 20.5619,
"lon": -100.2449,
"org": "AS42473 The Constant Company, LLC",
"postal": "76264",
"timezone": "America/Mexico_City"
}
]
}
]
}代币消耗
从指定 slot 开始检索 100 条 Leader slot 记录。
每次请求消耗 420 个代币。
为什么 Leader Slot 信息很重要
- 当 Leader 地理位置较远(例如 >100 ms)时,直接交易传输效率会降低。
- 在跨洲 Leader 切换期间(例如 FRA → NY),区域切换策略至关重要。
- 将 slot 调度与实测 ping 数据相结合,可以实现优化路由和验证者部署。
背景
单个 Solana epoch 大约包含 432,000 个 slot。
持续 ping 所有验证者、存储和聚合数据需要高成本的基础设施。
ERPC 自动化了这一过程,并提供可立即使用的 Leader slot 地图作为服务。
策略性使用场景
- **检测优化:**优先向附近(低延迟)的 Leader 发送交易
- **多区域部署:**在 FRA、NY、TY 等地部署,以最小化 slot 切换间隙
- **可视化和分析:**按区域监控 Leader 比例和延迟分布
可用性
getLeaderSlots 对所有 ERPC 用户开放。
API 代币(使用积分)可在 Validators DAO Discord 上发放或验证。- Discord:https://discord.gg/C7ZQSrCkYR
交易成功率与 SWQoS 端点
为了进一步提高交易成功率和执行速度,
我们建议使用 SWQoS 端点。
SWQoS(质押加权服务质量)优先处理具有质押连接的验证者。
Leader 将大约 80% 的带宽分配给优先流量,20% 分配给非优先流量,
优先通道的吞吐量约为5 倍。
此调度在 Priority fee 评估之前进行,
这意味着进入 SWQoS 优先通道是实现真正低延迟性能的先决条件。