> ## Documentation Index
> Fetch the complete documentation index at: https://docs.optimism.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Loading a Rollup Config from a Chain ID

In this section, the code examples demonstrate loading the
rollup config for the given L2 Chain ID.

Let's load the Rollup Config for OP Mainnet which hash chain id 10.

```rust theme={null}
extern crate kona_genesis;
extern crate kona_protocol;

use kona_registry::ROLLUP_CONFIGS;
use kona_genesis::OP_MAINNET_CHAIN_ID;

// Load a rollup config from the chain id.
let op_mainnet_config = ROLLUP_CONFIGS.get(&OP_MAINNET_CHAIN_ID).expect("infallible");

// The chain id should match the hardcoded chain id.
assert_eq!(op_mainnet_config.chain_id, OP_MAINNET_CHAIN_ID);
```

<Note>
  Available Configs

  [kona-registry][kona-registry] dynamically provides all rollup configs
  from the [superchain-registry][registry] for their respective chain ids.
  Note though, that this requires `serde` since it deserializes the rollup
  configs dynamically from json files.
</Note>

[kona-registry]: https://crates.io/crates/kona-registry

[registry]: https://github.com/ethereum-optimism/superchain-registry
