# Testing

The testing environment is connected to **Chainflip Perseverance Testnet**.

## Important URLs

| Name | URL                                                                                       |
| --- |-------------------------------------------------------------------------------------------|
| Register | https://perseverance.chainflip-broker.io/register                                         |
| API Base Url | https://perseverance.chainflip-broker.io/                                                 |
| API Documentation | https://perseverance.chainflip-broker.io/docs/ui/                                         |
| API Swagger Schema | https://perseverance.chainflip-broker.io/docs/v1/docs.json                               |
| Chainflip Explorer | https://scan.perseverance.chainflip.io/                                                   |
| Chainflip Chain | https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Farchive.perseverance.chainflip.io#/explorer |

## Over Tor (.onion)

The testing environment has its own Tor v3 onion services, both the API and this documentation site, so you can try the API without your IP address reaching us before you go anywhere near mainnet.
They serve the same API surface as clearnet: same paths, same parameters, same API key, same
responses.

Tor Browser needs no configuration. If you visit the clearnet site in Tor Browser it will offer you
the onion version automatically, because we send an `Onion-Location` header.

> **Tip**
>
> **Read these docs over Tor as well.** Calling the API over Tor while reading the integration guide
> over clearnet still tells us, and anyone watching your connection, that someone at your address is
> planning to integrate. The documentation onion above closes that gap:
>
> ```
> http://broker45ckafaqt342nxdim45mwtmxqwfvhjtkj4zyihlnvjqyeeeoqd.onion/environments/testing/
> ```

A `.onion` endpoint hides the API *caller*. It does not hide the *swap*: the deposit address, the
amounts, the timing and the destination are all on-chain and permanently public, exactly as they are
over clearnet.

| Name | Address |
| --- | --- |
| Testing API | `broker37cyuuvorore4mbcexbc6pw47n6xdx65upkrecq3eumqgtmnad.onion` |
| Testing documentation | `broker45ckafaqt342nxdim45mwtmxqwfvhjtkj4zyihlnvjqyeeeoqd.onion` |

```bash
# Note --socks5-hostname, not --socks5: the .onion name must be resolved by Tor, not by your
# machine's resolver.
curl --socks5-hostname 127.0.0.1:9050 \
  "http://broker37cyuuvorore4mbcexbc6pw47n6xdx65upkrecq3eumqgtmnad.onion/quotes?apiKey=YOUR_KEY&sourceAsset=btc.btc&destinationAsset=eth.eth&amount=0.1"
```

These are separate identities from the production ones, with separate keys. A testnet address is
never a stand-in for the mainnet address and vice versa.

See [Tor (.onion)](https://docs.chainflip-broker.io/environments/tor/) for the full detail: what it protects, the MCP endpoint
over Tor, and the operational caveats.
