nautechsystems/nautilus_trader · critical

Unsupported blockchain {blockchain} for RPC connection

Error message

Unsupported blockchain {blockchain} for RPC connection

What it means

initialize_rpc_client maps a configured Blockchain enum to a concrete WebSocket RPC client (Arbitrum, Bsc, ...). If the blockchain is not one of the explicitly supported variants, the code panics with this message instead of returning a Result. It signals a configuration/coverage gap: the adapter simply has no RPC client implementation for that chain.

Source

Thrown at crates/adapters/blockchain/src/data/core.rs:272

        proxy_url: Option<String>,
    ) -> BlockchainRpcClientAny {
        let mut client = match blockchain {
            Blockchain::Ethereum => {
                BlockchainRpcClientAny::Ethereum(EthereumRpcClient::new(wss_rpc_url, proxy_url))
            }
            Blockchain::Polygon => {
                BlockchainRpcClientAny::Polygon(PolygonRpcClient::new(wss_rpc_url, proxy_url))
            }
            Blockchain::Base => {
                BlockchainRpcClientAny::Base(BaseRpcClient::new(wss_rpc_url, proxy_url))
            }
            Blockchain::Arbitrum => {
                BlockchainRpcClientAny::Arbitrum(ArbitrumRpcClient::new(wss_rpc_url, proxy_url))
            }
            Blockchain::Bsc => {
                BlockchainRpcClientAny::Bsc(BscRpcClient::new(wss_rpc_url, proxy_url))
            }
            _ => panic!("Unsupported blockchain {blockchain} for RPC connection"),
        };
        client.set_transport_backend(transport_backend);
        client
    }

    /// Establishes connections to all configured data sources and initializes the cache.
    ///
    /// # Errors
    ///
    /// Returns an error if cache initialization or connection setup fails.
    pub async fn connect(&mut self) -> anyhow::Result<()> {
        log::debug!(
            "Connecting blockchain data client for '{}'",
            self.chain.name
        );
        self.initialize_cache_database().await;

        if let Some(ref mut rpc_client) = self.rpc_client {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Change the node/data-source config so the blockchain is Arbitrum or Bsc, the only variants with RPC clients here
  2. Check which Blockchain variants the installed adapter version supports (match arms in core.rs) before configuring others
  3. Add a new match arm wiring the chain to a concrete BlockchainRpcClient if you are extending the adapter
  4. Replace the panic with a Result::Err so misconfiguration surfaces as a clean startup error rather than an abort

Example fix

// before (config.toml)
blockchain = "solana"
// after
blockchain = "arbitrum"
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED: &[Blockchain] = &[Blockchain::Arbitrum, Blockchain::Bsc];
fn validate_blockchain(b: Blockchain) -> Result<(), String> {
    if SUPPORTED.contains(&b) { Ok(()) } else { Err(format!("{b:?} has no RPC client")) }
}

Type guard

fn is_supported(b: &Blockchain) -> bool {
    matches!(b, Blockchain::Arbitrum | Blockchain::Bsc)
}

Prevention

When it happens

Trigger: Calling initialize_rpc_client (during data engine setup / establish_connections) with a Blockchain variant other than Arbitrum or Bsc, e.g. Blockchain::Ethereum, Blockchain::Solana, or a default-constructed/unknown chain in the node config.

Common situations: Operators list a chain in their config file that the binary was built without support for; a new Blockchain enum variant was added upstream before the RPC client was implemented; a config parser deserializes an arbitrary string into Blockchain without validation.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/9564259a53d7fa9b. Report an issue: GitHub.