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
允許 ICMP 延遲探測來源
選擇 Shreds 區域時,ERPC 會從下列代理主機向您已註冊的 IP 傳送 ICMP 延遲探測。請允許來自所有列出來源 IP 的傳入 ICMP Echo Request。如果防火牆(ufw、雲端防火牆、安全性群組等)阻擋這些要求,測量結果可能變為
9999ms,並可能選到非最佳區域。同一區域中的多個 IP 分別屬於不同的探測主機,必須全部允許。| 探測區域 | ICMP 來源 IP |
|---|---|
| 🇳🇱 Amsterdam | 64.130.43.108 |
| 🇺🇸 New York | 64.130.37.235 |
| 🇩🇪 Frankfurt | 64.130.41.236 |
| 🇯🇵 Tokyo | 198.13.133.89 |
| 🇸🇬 Singapore | 67.209.55.19 |
| 🇬🇧 London | 64.130.63.211 |
| 🛰️ Far Point | 198.13.133.126 |
| 🇦🇺 Sydney | 82.26.116.35 |
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