{"record":{"id":"9564259a53d7fa9b","repo":"nautechsystems/nautilus_trader","slug":"unsupported-blockchain-blockchain-for-rpc-connec","errorCode":null,"errorMessage":"Unsupported blockchain {blockchain} for RPC connection","messagePattern":"Unsupported blockchain (.+?) for RPC connection","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/adapters/blockchain/src/data/core.rs","lineNumber":272,"sourceCode":"        proxy_url: Option<String>,\n    ) -> BlockchainRpcClientAny {\n        let mut client = match blockchain {\n            Blockchain::Ethereum => {\n                BlockchainRpcClientAny::Ethereum(EthereumRpcClient::new(wss_rpc_url, proxy_url))\n            }\n            Blockchain::Polygon => {\n                BlockchainRpcClientAny::Polygon(PolygonRpcClient::new(wss_rpc_url, proxy_url))\n            }\n            Blockchain::Base => {\n                BlockchainRpcClientAny::Base(BaseRpcClient::new(wss_rpc_url, proxy_url))\n            }\n            Blockchain::Arbitrum => {\n                BlockchainRpcClientAny::Arbitrum(ArbitrumRpcClient::new(wss_rpc_url, proxy_url))\n            }\n            Blockchain::Bsc => {\n                BlockchainRpcClientAny::Bsc(BscRpcClient::new(wss_rpc_url, proxy_url))\n            }\n            _ => panic!(\"Unsupported blockchain {blockchain} for RPC connection\"),\n        };\n        client.set_transport_backend(transport_backend);\n        client\n    }\n\n    /// Establishes connections to all configured data sources and initializes the cache.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if cache initialization or connection setup fails.\n    pub async fn connect(&mut self) -> anyhow::Result<()> {\n        log::debug!(\n            \"Connecting blockchain data client for '{}'\",\n            self.chain.name\n        );\n        self.initialize_cache_database().await;\n\n        if let Some(ref mut rpc_client) = self.rpc_client {","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/data/core.rs#L254-L290","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (config.toml)\nblockchain = \"solana\"\n// after\nblockchain = \"arbitrum\"","handlingStrategy":"validation","validationCode":"const SUPPORTED: &[Blockchain] = &[Blockchain::Arbitrum, Blockchain::Bsc];\nfn validate_blockchain(b: Blockchain) -> Result<(), String> {\n    if SUPPORTED.contains(&b) { Ok(()) } else { Err(format!(\"{b:?} has no RPC client\")) }\n}","typeGuard":"fn is_supported(b: &Blockchain) -> bool {\n    matches!(b, Blockchain::Arbitrum | Blockchain::Bsc)\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["rust","panic","blockchain","rpc","configuration"],"backgroundTag":"unsupported-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}