{"record":{"id":"5129293e20cf646a","repo":"nautechsystems/nautilus_trader","slug":"invalid-chain-name-chain","errorCode":null,"errorMessage":"Invalid chain name: {chain}","messagePattern":"Invalid chain name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/blockchain/analyze.rs","lineNumber":504,"sourceCode":"    let config = BlockchainDataClientConfig::builder()\n        .chain(Arc::new(chain.clone()))\n        .dex_ids(vec![dex_type])\n        .http_rpc_url(rpc_http_url.into())\n        .maybe_multicall_calls_per_rpc_request(multicall_calls_per_rpc_request)\n        .use_hypersync_for_live_data(true)\n        .postgres_cache_database_config(postgres_connect_options)\n        .build();\n    let cancellation_token = tokio_util::sync::CancellationToken::new();\n    let mut data_client = BlockchainDataClientCore::new(config, None, None, cancellation_token);\n    data_client.initialize_cache_database().await;\n    data_client.cache.initialize_chain().await;\n\n    Ok(data_client)\n}\n\nfn parse_chain_dex(chain: &str, dex: &str) -> anyhow::Result<(Chain, DexType)> {\n    let chain = Chain::from_chain_name(chain)\n        .ok_or_else(|| anyhow::anyhow!(\"Invalid chain name: {chain}\"))?;\n\n    let dex_type = find_dex_type_case_insensitive(dex, chain).ok_or_else(|| {\n        let supported_dexes = get_supported_dexes_for_chain(chain.name);\n        if supported_dexes.is_empty() {\n            anyhow::anyhow!(\n                \"Invalid DEX name '{}' (case-insensitive). Chain '{}' is not supported for pool analysis.\",\n                dex, chain.name\n            )\n        } else {\n            anyhow::anyhow!(\n                \"Invalid DEX name '{}' (case-insensitive). Supported DEXes for chain '{}': {}\",\n                dex,\n                chain.name,\n                supported_dexes.join(\", \")\n            )\n        }\n    })?;\n","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/cli/src/blockchain/analyze.rs#L486-L522","documentation":"`parse_chain_dex` converts CLI strings into `Chain` and `DexType` values. If `Chain::from_chain_name` cannot map the provided `--chain` value to a known chain, this error is raised before any client is built.","triggerScenarios":"Invoking `nautilus blockchain analyze-pool`/`analyze-pools` with an unrecognized `--chain` string — misspelling, unsupported network, wrong casing not handled, or a chain added in a newer version than the installed binary.","commonSituations":"Typing `--chain eth` instead of a supported name, using a testnet/custom chain not in the registry, running an outdated nautilus binary that lacks a newly added chain.","solutions":["Use an exact supported chain name (see the chain registry/docs, e.g. `ethereum`, `base`, `arbitrum`).","Check spelling and casing against `Chain::from_chain_name` accepted values.","Upgrade the binary if the chain was added in a newer release.","Add a mapping for the custom chain if building from source."],"exampleFix":"// before\nnautilus blockchain analyze-pool --chain eth ...\n// after\nnautilus blockchain analyze-pool --chain ethereum ...","handlingStrategy":"validation","validationCode":"let supported: Vec<&str> = /* chain registry names */;\nif !supported.contains(&chain) {\n    eprintln!(\"unsupported chain '{chain}'; choose from: {supported:?}\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate CLI inputs against the chain registry before building clients.","Keep the binary up to date with newly supported chains.","List supported chains in --help output."],"tags":["cli","validation","blockchain","argument"],"backgroundTag":"invalid-cli-argument","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}