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

# Simulations 快速开始

> 通过 Node RPC 使用 tenderly_simulateTransaction 模拟您的第一笔交易，在几分钟内验证行为后再发送上链。

本快速入门指南演示了如何使用自定义 RPC 方法 `tenderly_simulateTransaction` 在 Node RPC 上模拟一笔单独的交易。请参阅 [RPC 模拟参考](/node-rpc/rpc-reference?network=ethereum-mainnet\&method=tenderly_simulateTransaction)。模拟允许您在将交易发送到区块链之前精确验证其行为。

<Note>
  模拟 RPC 在 [Node RPC](/node-rpc/rpc-reference?network=ethereum-mainnet\&method=tenderly_simulateTransaction) 和 [虚拟环境 RPC](/virtual-environments/interact/simulate-transactions) 上均可用。
</Note>

## 获取 RPC URL

登录您的 [Tenderly 账户](https://dashboard.tenderly.co/register?redirectTo=gateways)，然后从左侧菜单点击 **Node**。

复制您所需网络的 RPC URL。如果您的网络不受 Node 支持，请改为[通过 API 模拟](/simulations/single-simulations#simulate-via-api)。

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
https://mainnet.gateway.tenderly.co/${TENDERLY_NODE_ACCESS_KEY}
```

访问密钥会自动追加到 RPC URL 的末尾。

## 发送请求

向该 RPC URL 发送 `POST` 请求。

请求必须包含：

* 附带访问密钥的 RPC URL。
* 对 RPC 方法 `tenderly_simulateTransaction` 的调用。
* 交易参数，如 `from`、`to`、`gas`、`gas price`、`value` 和 `data`。

**示例 cURL 请求**

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
curl https://mainnet.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "id": 0,
    "jsonrpc": "2.0",
    "method": "tenderly_simulateTransaction",
    "params": [
      {
        "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
        "gas": "0x0",
        "value": "0x0",
        "data": "0xa9059cbb00000000000000000000000020a5814b73ef3537c6e099a0d45c798f4bd6e1d60000000000000000000000000000000000000000000000000000000000000001"
      },
      "latest"
    ]
  }'
```

## 探索使用场景

* [**资产与余额变化**](/simulations/asset-balance-changes)：获取即将发生的所有余额与资产变化的确切美元价值。
* [**Gas 估算**](/simulations/gas-estimation)：在发送交易之前准确预测 gas 费用。
* [**状态覆盖**](/simulations/state-overrides)：修改时间戳、合约数据等区块链状态，以测试不同的场景。
* [**预览交易结果**](/simulations/transaction-preview)：识别并修复可能导致交易失败的问题。

## 后续内容

<Card title="捆绑模拟" href="" />

<Card title="通过 SDK 模拟" href="" />
