sol-rpc-router

Crates.iosol-rpc-router
lib.rssol-rpc-router
version0.2.0
created_at2025-12-21 09:51:34.14257+00
updated_at2025-12-21 09:59:36.565657+00
descriptionSolana RPC Router that splits requests across multiple providers
homepage
repositoryhttps://github.com/F3kilo/sol-rpc-router
max_upload_size
id1997780
size271,593
f3kilo (F3kilo)

documentation

README

Solana RPC Router

Overview

This router splits Solana RPC requests into several RPC providers, taking into account rate limits of each provider.

Usage

API is mostly compatible with solana-rpc-client v3 crate and implementation is built on top of it. To initialize the RPC client, you need to provide a config for available providers:

fn main() {
    let config = RpcClientConfig {
        providers: vec![
            commitment: "confirmed",
            ProviderConfig {
                name: "provider1".to_string(),
                url: "https://provider1.com".to_string(),
                rate_limit: 1000,
            },
            ProviderConfig {
                name: "provider2".to_string(),
                url: "https://provider2.com".to_string(),
                rate_limit: 500,
            },
        ],
    };

    let client = RpcClient::new(config);
    client.get_account_info("some_account").await;
}

Config file

You can provide a configuration file with the following format:

{
  "providers": [
    {
      "name": "provider1",
      "url": "https://provider1.com",
      "rate_limit": 1000
    },
    {
      "name": "provider2",
      "url": "https://provider2.com",
      "rate_limit": 500
    }
  ]
}
Commit count: 0

cargo fmt