Direct Shreds - 快速入门
安装 SLV
bash
curl -fsSL https://storage.slv.dev/slv/install | shcurl -fsSL https://storage.slv.dev/slv/install | sh$ slv b init

只需一条命令
slv b init,即可立即搭建基于高性能流数据的 Solana 机器人开发环境。bash
slv b initslv b init- 如果您偏好基于 TypeScript 的 Shreds 机器人,请选择
shreds-ts - 如果您偏好利用 Shreds 的 Rust 机器人,请选择
shreds-rust
将 Shreds 负载均衡器 IP 加入白名单
我们使用每个区域 Shreds 负载均衡器的实时 ping 检测,选择距离您注册 IP 最近的节点。如果防火墙(ufw、安全组等)阻止了 ICMP,ping 结果可能变为
9999ms,这可能导致无法选择最佳的就近区域。请将以下 IP 加入白名单,以便自动使用最近的区域。| 区域 | 域名 | IP 地址 |
|---|---|---|
| 🇳🇱 阿姆斯特丹 | shreds-ams6-1.erpc.global | 64.130.43.108 |
| 🇩🇪 法兰克福 | shreds-fra6-1.erpc.global | 64.130.41.236 |
| 🇬🇧 伦敦 | shreds-lon6-1.erpc.global | 64.130.63.211 |
| 🇮🇪 都柏林 | shreds-dub6-1.erpc.global | 82.40.61.2 |
| 🇺🇸 纽约 | shreds-ny6-1.erpc.global | 64.130.37.235 |
| 🇺🇸 芝加哥 | shreds-chi-2.erpc.global | 84.32.71.34 |
| 🇺🇸 盐湖城 | shreds-slc6-1.erpc.global | 72.244.154.7 |
| 🇸🇬 新加坡 | shreds-sgp6-1.erpc.global | 67.209.55.19 |
| 🇯🇵 东京 | shreds-ty6-1.erpc.global | 198.13.133.89 |
Shreds 客户端示例 - TypeScript
- 将
.env.sample文件重命名为.env。 - 使用您的实际端点更新
.env文件中的值:
ini
SHREDS_ENDPOINT=http://shreds-ams6-1.erpc.global
SOLANA_RPC_ENDPOINT="https://edge.erpc.global?api-key=YOUR_API_KEY"SHREDS_ENDPOINT=http://shreds-ams6-1.erpc.global
SOLANA_RPC_ENDPOINT="https://edge.erpc.global?api-key=YOUR_API_KEY"⚠️ **重要提示:**此端点仅作为示例提供,不能直接使用。请获取并设置您的实际端点。
- 安装依赖并运行脚本:
bash
pnpm i
pnpm devpnpm i
pnpm dev
Shreds 客户端示例 - Rust
- 将
.env.sample重命名为.env - 使用您的实际 Shreds 端点编辑
.env:
ini
SHREDS_ENDPOINT=http://shreds-ams6-1.erpc.global
SOLANA_RPC_ENDPOINT="https://edge.erpc.global?api-key=YOUR_API_KEY"SHREDS_ENDPOINT=http://shreds-ams6-1.erpc.global
SOLANA_RPC_ENDPOINT="https://edge.erpc.global?api-key=YOUR_API_KEY"请注意:
此端点为示例,不能直接使用。请获取并配置适合您环境的端点。
- 构建并运行客户端:
bash
RUST_LOG=info cargo runRUST_LOG=info cargo run
✅ 提供 1 天免费试用
Shreds 端点可通过 Validators DAO Discord 官方服务器免费试用 1 天。
Solana Stream SDK

通过
slv b init 命令下载的 Shreds 启动代码中包含的客户端实现
由开源项目 Solana Stream SDK 提供支持。该 SDK 同时支持 Rust 和 TypeScript,能够高效处理 Solana 的直接通信层——
包括 Shreds 订阅、数据包解析和交易提取。
使用此 SDK,您可以立即开始 Shreds 流开发。
slv b init 生成的启动代码可作为实用模板,供您在此基础上构建自己的应用。更多详情请访问 GitHub 仓库:
https://github.com/ValidatorsDAO/solana-stream