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
- Change the node/data-source config so the blockchain is Arbitrum or Bsc, the only variants with RPC clients here
- Check which Blockchain variants the installed adapter version supports (match arms in core.rs) before configuring others
- Add a new match arm wiring the chain to a concrete BlockchainRpcClient if you are extending the adapter
- 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
- Validate blockchain config values at startup, before engines are built
- Keep an explicit list of chains your build supports and check config against it
- When adding a Blockchain variant, add its RPC client match arm in the same change
- Prefer Result-returning initializers over panics in adapter setup code
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
- Finalized block {} does not contain transaction {}
- in-flight mutex poisoned
- wallet balance mutex poisoned
- Kraken Spot does not support the demo environment
- Redis config error: username supplied without password. Eith
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/9564259a53d7fa9b.
Report an issue: GitHub.