> ## 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.

# Transactions Simulate करें

> भेजने से पहले Virtual Environment पर एक transaction को simulate करके इसके परिणाम, gas usage, state changes, और emitted events का पूर्वावलोकन करें।

Transaction simulations Virtual Environments पर समर्थित हैं। आप Dashboard UI से या RPC का उपयोग करके प्रोग्रामेटिक रूप से transactions को simulate कर सकते हैं।

<CardGroup cols={2}>
  <Card title="Simulator UI" href="/simulator-ui/overview" />

  <Card title="Simulation RPC" href="/node-rpc/rpc-reference?network=ethereum-mainnet&method=tenderly_simulateTransaction" />

  <Card title="Bundle Simulation RPC" href="/node-rpc/rpc-reference?network=ethereum-mainnet&method=tenderly_simulateBundle" />

  <Card title="Simulation API on Virtual Environments" href="/api-reference" />
</CardGroup>

## Dashboard से Simulate करें

Dashboard से transaction को simulate करने के लिए, **Virtual Environments** पर जाएं और left-hand menu से **Simulate** पर क्लिक करें। Simulated transactions केवल Virtual Environment dashboard के अंदर दिखाई देते हैं और [Public Explorer](/virtual-environments/explorer#public-explorer) में दिखाई नहीं देंगे।
आप Simulator का उपयोग निम्नलिखित तरीकों से कर सकते हैं:

* **Edit Source** का उपयोग करके अपने bugfix की जाँच करने के लिए smart contracts errors को debug करें।
* transactions को network पर persist किए बिना states का अनुभव प्राप्त करने के लिए contracts को call करें।
* **State Overrides** का उपयोग करके इच्छित contract states सेट करें, ऐसी परिस्थितियों के तहत execution का मूल्यांकन करने के लिए जो chain पर मौजूद नहीं हैं और नहीं होनी चाहिए।
* testing scenarios को validate करने के लिए proof of concept transactions बनाएं।

## RPC के माध्यम से Simulate करें

Virtual Environments पर Transactions को RPC methods [`tenderly_simulate`](/node-rpc/rpc-reference?network=ethereum-mainnet\&method=tenderly_simulateTransaction) और [`tenderly_simulateBundle`](/node-rpc/rpc-reference?network=ethereum-mainnet\&method=tenderly_simulateBundle) का उपयोग करके भी simulate किया जा सकता है।

<Note>
  हम Simulation RPC को integrate करने की सिफारिश करते हैं, लेकिन [Simulation REST API](/api-reference) का उपयोग करना संभव है।
</Note>

नीचे दिया गया example code एक simulation चलाता है जो DAI mint करने के लिए state overrides का उपयोग करता है।

* Sender address: `0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2`।
* DAI contract address: `0x6b175474e89094c44da98b954eedeac495271d0f`
* State override arguments: `DAI(0x6b175474e89094c44da98b954eedeac495271d0f).wards[0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2] = 1`

[state overrides के साथ simulating](/simulations/state-overrides) के बारे में अधिक जानने के लिए इस गाइड को explore करें।

```bash showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# simulate DAI minting by 0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2
# 0xf1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1 gets the minted DAI
# Simulated on the latest block

VIRTUAL_TESTNET_RPC=RPC_LINK_HERE

curl $VIRTUAL_TESTNET_RPC \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
  "id":0,
  "jsonrpc":"2.0",
  "method":"tenderly_simulateTransaction",
  "params":[
    {
      "from":"0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
      "to":"0x6b175474e89094c44da98b954eedeac495271d0f",
      "gas":"0x7a1200",
      "data":"0x40c10f19000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f10000000000000000000000000000000000000000000000001bc16d674ec80000"
    },
    "latest",
    {
      "0x6b175474e89094c44da98b954eedeac495271d0f":{
        "stateDiff":{
          "0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03":"0x0000000000000000000000000000000000000000000000000000000000000001"
        },
        "balance": "0xFFFFFF"
      }
    }
  ]
}'
```

## client libraries के माध्यम से transactions simulate करें

Ethers और Viem के माध्यम से transactions को simulate करने के लिए, निम्न example देखें:

<Card title="Simulating with Viem" href="" />
