| Crates.io | yellowstone-vixen-yellowstone-grpc-source |
| lib.rs | yellowstone-vixen-yellowstone-grpc-source |
| version | 0.3.0 |
| created_at | 2025-07-24 05:30:27.248878+00 |
| updated_at | 2025-09-15 12:05:29.525616+00 |
| description | Yellowstone gRPC source for the Yellowstone Vixen |
| homepage | |
| repository | https://github.com/rpcpool/yellowstone-vixen |
| max_upload_size | |
| id | 1765541 |
| size | 65,166 |
Yellowstone Vixen introduces a flexible Source system that allows you to connect to various data sources and stream their updates through a standardized interface. This feature is designed to be extensible, allowing you to create custom sources while maintaining a consistent API.
The Source trait provides a standardized way to:
Here's a step-by-step guide to creating your own source:
use async_trait::async_trait;
use tokio::sync::mpsc::Sender;
use yellowstone_vixen::sources::Source;
use yellowstone_vixen::config::YellowstoneConfig;
use vixen_core::Filters;
#[derive(Debug)]
struct MyCustomSource {
filters: Option<Filters>,
config: Option<YellowstoneConfig>,
}
#[async_trait]
impl Source for MyCustomSource {
async fn connect(
&self,
tx: Sender<Result<SubscribeUpdate, Status>>,
) -> Result<JoinSet<()>, crate::Error> {
// Your connection logic here
todo!()
}
fn name(&self) -> String {
"my-custom-source".to_string()
}
// ... other required methods
}
| Method | Description |
|---|---|
connect |
Establishes connection to the data source and streams updates |
name |
Returns a unique identifier for the source |
set_filters_unchecked |
Sets filters for data processing |
set_config_unchecked |
Sets source-specific configuration |
get_filters |
Retrieves current filters |
get_config |
Retrieves current configuration |
The trait provides two optional methods with safe default implementations:
filters: Safely sets filters if none are currently setconfig: Safely sets configuration if none is currently setconnect methodHere's a practical example of how to use a source:
vixen::Runtime::builder()
// Add the source to the runtime
.source(YellowstoneGrpcSource::new())
// We could call this multiple times to add concurrent Sources
// .source(SolanaAccountsRpcSource::new())
.account(Pipeline::new(TokenProgramAccParser, [Handler]))
.account(Pipeline::new(TokenExtensionProgramAccParser, [Handler]))
.instruction(Pipeline::new(TokenExtensionProgramIxParser, [Handler]))
.instruction(Pipeline::new(TokenProgramIxParser, [Handler]))
.build(config)
.run();
| Feature | Priority | Description |
|---|---|---|
| Source Testing Harness | High | Make it easy to test Source implementations and speed up contributions |
| Space for cleanup logic | Medium | Expose a method that can be used for Sources that need to cleanup resources |
| Support additional data sources | Medium | Add support for additional data sources |
We welcome contributions to expand the ecosystem of sources! When creating a new source:
If you need help or have questions, please open an issue on GitHub or also check other sources implementations in the repository.