# optimism_rollupConfig

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://worldchain-mainnet.g.alchemy.com/v2/{apiKey}

Get the rollup configuration parameters.

Reference: https://www.alchemy.com/docs/chains/world-chain/world-chain-api-endpoints/optimism-rollup-config

## Result

**Rollup configuration** (object): The rollup configuration parameters

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://worldchain-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "optimism_rollupConfig"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'optimism_rollupConfig'})
};

fetch('https://worldchain-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://worldchain-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "optimism_rollupConfig"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://worldchain-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"optimism_rollupConfig\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://worldchain-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"optimism_rollupConfig\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://worldchain-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"optimism_rollupConfig\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: optimism_rollupConfig
description: Get the rollup configuration parameters.
x-compute-units: 10
params: []
result:
  name: Rollup configuration
  description: The rollup configuration parameters
  schema:
    type: object
    properties:
      genesis:
        type: object
        properties:
          l1:
            type: object
            properties:
              hash:
                type: string
                description: The hash of the L1 genesis block
              number:
                type: string
                description: The block number of the L1 genesis block
          l2:
            type: object
            properties:
              hash:
                type: string
                description: The hash of the L2 genesis block
              number:
                type: string
                description: The block number of the L2 genesis block
              l2_time:
                type: string
                description: The timestamp associated with the L2 genesis block
      system_config:
        type: object
        properties:
          batcherAddr:
            type: string
            description: The address of the batcher
          overhead:
            type: string
            description: The overhead value for the system configuration
          scalar:
            type: string
            description: The scalar value for the system configuration
          gasLimit:
            type: string
            description: The gas limit for the system configuration
          block_time:
            type: string
            description: The time it takes to produce a block, specified in seconds
          max_sequencer_drift:
            type: string
            description: The maximum allowable drift for sequencers, specified in seconds
          seq_window_size:
            type: string
            description: The size of the sequencer window, specified in seconds
          channel_timeout:
            type: string
            description: The timeout duration for channels, specified in seconds
          l1_chain_id:
            type: string
            description: The chain ID for the L1 chain
          l2_chain_id:
            type: string
            description: The chain ID for the L2 chain
          regolith_time:
            type: string
            description: The regolith time, specified in seconds
          canyon_time:
            type: string
            description: The canyon time in UNIX timestamp format
          batch_inbox_address:
            type: string
            description: The address of the batch inbox
          deposit_contract_address:
            type: string
            description: The address of the deposit contract
          l1_system_config_address:
            type: string
            description: The address of the L1 system configuration
          protocol_versions_address:
            type: string
            description: The address of the protocol versions
```
