mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-23 05:48:05 +00:00
Merge branch 'main' of github.com:0xfnzero/solana-streamer into main
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "solana-streamer"
|
name = "solana-streamer-sdk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ Add the dependency to your `Cargo.toml`:
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.toml
|
# Add to your Cargo.toml
|
||||||
solana-streamer = { path = "./solana-streamer", version = "0.1.0" }
|
solana-streamer-sdk = { path = "./solana-streamer", version = "0.1.0" }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use solana_streamer::{
|
use solana_streamer_sdk::{
|
||||||
match_event,
|
match_event,
|
||||||
streaming::{
|
streaming::{
|
||||||
event_parser::{
|
event_parser::{
|
||||||
@@ -96,7 +96,7 @@ async fn test_shreds() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
Protocol::RaydiumCpmm,
|
Protocol::RaydiumCpmm,
|
||||||
Protocol::RaydiumClmm,
|
Protocol::RaydiumClmm,
|
||||||
];
|
];
|
||||||
|
|
||||||
println!("Listening for events, press Ctrl+C to stop...");
|
println!("Listening for events, press Ctrl+C to stop...");
|
||||||
shred_stream
|
shred_stream
|
||||||
.shredstream_subscribe(protocols, None, callback)
|
.shredstream_subscribe(protocols, None, callback)
|
||||||
|
|||||||
+3
-3
@@ -31,13 +31,13 @@ git clone https://github.com/0xfnzero/solana-streamer
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.toml
|
# 添加到您的 Cargo.toml
|
||||||
solana-streamer = { path = "./solana-streamer", version = "0.1.0" }
|
solana-streamer-sdk = { path = "./solana-streamer", version = "0.1.0" }
|
||||||
```
|
```
|
||||||
|
|
||||||
## 使用示例
|
## 使用示例
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use solana_streamer::{
|
use solana_streamer_sdk::{
|
||||||
match_event,
|
match_event,
|
||||||
streaming::{
|
streaming::{
|
||||||
event_parser::{
|
event_parser::{
|
||||||
@@ -96,7 +96,7 @@ async fn test_shreds() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
Protocol::RaydiumCpmm,
|
Protocol::RaydiumCpmm,
|
||||||
Protocol::RaydiumClmm,
|
Protocol::RaydiumClmm,
|
||||||
];
|
];
|
||||||
|
|
||||||
println!("开始监听事件,按 Ctrl+C 停止...");
|
println!("开始监听事件,按 Ctrl+C 停止...");
|
||||||
shred_stream
|
shred_stream
|
||||||
.shredstream_subscribe(protocols, None, callback)
|
.shredstream_subscribe(protocols, None, callback)
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
use solana_streamer::{
|
use solana_streamer_sdk::{
|
||||||
match_event,
|
match_event,
|
||||||
streaming::{
|
streaming::{
|
||||||
event_parser::{
|
event_parser::{
|
||||||
|
|||||||
Reference in New Issue
Block a user