> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/clients/python/chains/make-seismic-testnet.md).

# make\_seismic\_testnet

Factory function that creates a [`ChainConfig`](/clients/python/chains/chain-config.md) for a Seismic testnet node.

## Overview

`make_seismic_testnet` generates a chain configuration for a GCP testnet node or a custom host. This is useful when you need to connect to alternate testnet nodes beyond the default [`SEISMIC_TESTNET`](/clients/python/chains/seismic-testnet.md) (which is GCP node 1).

## Definition

```python
def make_seismic_testnet(
    n: int = 1,
    *,
    host: str | None = None,
) -> ChainConfig:
```

## Parameters

| Parameter | Type          | Required | Default | Description                                  |
| --------- | ------------- | -------- | ------- | -------------------------------------------- |
| `n`       | `int`         | No       | `1`     | GCP node number                              |
| `host`    | `str \| None` | No       | `None`  | Custom hostname. Mutually exclusive with `n` |

Raises `ValueError` if both `n` and `host` are provided.

## Returns

* `ChainConfig` - A chain configuration for the specified testnet

## Examples

### Connect to Alternate GCP Nodes

```python
import os
from seismic_web3 import make_seismic_testnet, PrivateKey

pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])

# GCP node 1 (same as SEISMIC_TESTNET)
testnet_1 = make_seismic_testnet(1)
w3_1 = testnet_1.wallet_client(pk)

# GCP node 2
testnet_2 = make_seismic_testnet(2)
w3_2 = testnet_2.wallet_client(pk)
```

### Custom Host

```python
from seismic_web3 import make_seismic_testnet

testnet = make_seismic_testnet(host="my-testnet.example.com")
print(testnet.rpc_url)  # "https://my-testnet.example.com/rpc"
```

### Default Parameter

```python
from seismic_web3 import make_seismic_testnet

# No argument defaults to GCP node 1
testnet = make_seismic_testnet()

print(testnet.rpc_url)  # "https://testnet-1.seismictest.net/rpc"
```

## Relationship to SEISMIC\_TESTNET

The default [`SEISMIC_TESTNET`](/clients/python/chains/seismic-testnet.md) constant is defined as:

```python
SEISMIC_TESTNET: ChainConfig = make_seismic_testnet(1)
```

## See Also

* [ChainConfig](/clients/python/chains/chain-config.md) - Chain configuration dataclass
* [SEISMIC\_TESTNET](/clients/python/chains/seismic-testnet.md) - Pre-defined testnet (GCP node 1)
* [PrivateKey](/clients/python/api-reference/types/private-key.md) - Private key type


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.seismic.systems/clients/python/chains/make-seismic-testnet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
