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

# Connect to Testnet

> Create an RPC endpoint, configure cast, and verify the Metal Testnet connection

Create an RPC endpoint in the [Metal console](https://console-testnet.metalntwx.com).
An endpoint is the URL your application uses to send requests to Metal. The
gateway uses its endpoint ID to apply your access settings and track usage.
Use Foundry's `cast` to read the chain ID, block height, and finalized head.

## Network details

| Parameter | Value |
| - | - |
| Network name | Metal Testnet |
| Chain ID | `63825` (`0xf951`) |
| RPC URL | `https://rpc-testnet.metalntwx.com/v1/<endpoint-id>` |
| Currency display | `USDZ`, 18 decimals |
| Explorer | `https://testnet.metalntwx.com` |

## 1. Install cast

`cast` is Foundry's command-line tool for EVM networks. Check whether it is
already installed:

```bash theme={null}
cast --version
```

If the command is unavailable, install Foundry with its official installer:

```bash theme={null}
curl -L https://getfoundry.sh/install | bash
```

Restart your terminal, then install the Foundry tools:

```bash theme={null}
foundryup
cast --version
```

> [!NOTE]
>
> On Windows, run the installer from Git Bash or WSL. See the
> [Foundry installation guide](https://getfoundry.sh/introduction/installation/)
> for other installation methods.

## 2. Create an RPC endpoint

1. Sign in to the [Metal console](https://console-testnet.metalntwx.com).
2. Complete billing setup using the test card shown in the console. Testnet uses sandbox billing and grants \$50 of RPC credit after setup.
3. Open **Endpoints** and select **+ New endpoint**.
4. Give it a name, and select the testnet network.
5. Select **Create endpoint**, then copy the **Endpoint URL**.

> [!NOTE]
>
> RPC credit pays for requests through your endpoint. It stays in the console's
> billing account. Fund your blockchain address separately with test \*USDZ from
> the [faucet](https://docs.metalntwx.com/build/prepare/fund-a-test-account.md) to pay for transfers and transaction gas.
> Sandbox billing uses test cards and makes no real charges.

The console generates the endpoint ID and includes it in the URL. Copy the
whole URL into `METAL_RPC_URL`, replacing the placeholder below:

```bash theme={null}
export METAL_RPC_URL="https://rpc-testnet.metalntwx.com/v1/<endpoint-id>"
```

## 3. Verify the connection

Read the chain ID:

```bash theme={null}
cast chain-id --rpc-url "$METAL_RPC_URL"
```

A healthy connection returns chain ID: `63825`. Then read the current block number:

```bash theme={null}
cast block-number --rpc-url "$METAL_RPC_URL"
```

Run the block-number command again after a few seconds. A healthy connection
returns an advancing block number.

## 4. Read finality

Metal exposes its finalized block through `consensus_status`:

```bash theme={null}
cast rpc consensus_status --rpc-url "$METAL_RPC_URL"
```

The response includes `head` and `finalized` block pointers. You will use the
finalized block to confirm settlement after sending your first transfer.

## 5. Verify with curl

Any JSON-RPC client can connect:

```bash theme={null}
curl "$METAL_RPC_URL" \
  -H "content-type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
```

The result should be `0xf951`.

> [card] [Make your first transfer](https://docs.metalntwx.com/start/make-your-first-transfer.md)
>
> Create test accounts, get \*USDZ, and send a transfer through your endpoint.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.