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

# Test RPCs

> How Rhaios uses managed chain forks for safe pre-production testing and preflight simulation.

# Test RPCs

Rhaios runs managed test RPCs — full Ethereum and Base chain forks that mirror mainnet state at a recent block. Agents can fund wallets, execute yield operations, and verify results without spending real tokens.

## What is a test RPC?

A test RPC is an isolated fork of a live chain. It has the same contract state, token balances, and protocol deployments as mainnet, but transactions on the fork do not affect the real chain.

Rhaios manages these forks automatically. When an agent calls a testing endpoint or the server runs a preflight simulation, the server routes the operation through the appropriate fork.

## Why test RPCs exist

| Use case                 | How it works                                                                                                                                                |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Pre-prod testing**     | Agents fund wallets and execute yield flows on a persistent fork. No real funds required.                                                                   |
| **Preflight simulation** | Before submitting a signed transaction to the real chain, `POST /v1/yield/execute` simulates it on an ephemeral fork to catch reverts before they cost gas. |

These are separate fork types:

* **Persistent forks** — one per chain, created on first use, auto-recreated if evicted. Used by `POST /v1/testing/fund-wallet` and `POST /v1/yield/setup-relay`.
* **Ephemeral forks** — created per-simulation, destroyed immediately after. Used by preflight simulation in `POST /v1/yield/execute`.

## Funding caps

Each `POST /v1/testing/fund-wallet` call is capped:

| Token | Max per call |
| ----- | ------------ |
| ETH   | 0.02 ETH     |
| USDC  | 50 USDC      |

Multiple calls are allowed. Caps are per-call, not per-wallet.

## Supported chains and tokens

| Chain    | Chain ID | USDC address                                 |
| -------- | -------- | -------------------------------------------- |
| Ethereum | 1        | `0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48` |
| Base     | 8453     | `0x833589fcd6edb6e08f4c7c32d4f71b54bda02913` |

## Testing workflow

```mermaid theme={null}
sequenceDiagram
    participant Agent
    participant Rhaios as Rhaios API

    Agent->>Rhaios: GET /v1/testing/fork-status
    Rhaios-->>Agent: Fork health, limits, supported tokens

    Agent->>Rhaios: POST /v1/testing/fund-wallet
    Rhaios-->>Agent: Resulting balances on test RPC

    Agent->>Rhaios: POST /v1/yield/prepare
    Rhaios-->>Agent: Intent envelope (+ setup if first time)

    Note over Agent: Sign locally

    Agent->>Rhaios: POST /v1/yield/execute
    Note over Rhaios: Preflight simulation on ephemeral fork
    Rhaios-->>Agent: Transaction hash + receipt
```

## Preflight simulation

When preflight is enabled, `POST /v1/yield/execute` creates an ephemeral test RPC at the latest block, simulates the signed transaction, and only submits to the bundler if simulation succeeds. The ephemeral fork is destroyed after each simulation regardless of outcome.

Simulation failures block execution and return an error. There is no mode that allows a failed simulation to proceed.

See [Architecture](/concepts/architecture) for more on the execution flow.

## Relationship to production

Test RPC operations never touch real chains. When you are ready for production:

1. Fund your agent wallet with real USDC on Base or Ethereum
2. Point your API calls at the production endpoint (`https://api.staging.rhaios.com`)
