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

# eth_simulateV1 के साथ Blocks Simulate करें

> standard eth_simulateV1 JSON-RPC मेथड के साथ batched calls, state overrides, और block overrides वाले blocks के अनुक्रम को simulate करें।

`eth_simulateV1` [Ethereum execution APIs](https://github.com/ethereum/execution-apis) विनिर्देश का standard multi-block simulation मेथड है। यह एक base block के ऊपर blocks के अनुक्रम को simulate करता है, जिनमें से प्रत्येक में calls का एक batch होता है, बिना कुछ भी on chain भेजे। एक block के भीतर calls क्रमिक रूप से निष्पादित होती हैं और state साझा करती हैं, और प्रत्येक simulated block पिछले block पर आधारित होता है।

यह मेथड [Node RPC](/node-rpc/overview) और [Virtual Environments](/virtual-environments/overview) पर चलता है; प्रत्येक मेथड और नेटवर्क के लिए पूर्ण [JSON-RPC reference](/node-rpc/rpc-reference) देखें। नेटवर्क का एक छोटा समूह इसे समर्थन नहीं करता; [नेटवर्क उपलब्धता](#नेटवर्क-उपलब्धता) देखें।

जब आपको portable, spec-standard simulation की आवश्यकता हो जो block के आकार के परिणाम लौटाती है, तब `eth_simulateV1` का उपयोग करें। डिकोडेड logs, call traces, और asset और balance changes के लिए, एक ही transaction के लिए [`tenderly_simulateTransaction`](/node-rpc/guides/simulate-json-rpc) या transactions के अनुक्रम के लिए [`tenderly_simulateBundle`](/node-rpc/guides/simulate-bundle-json-rpc) का उपयोग करें।

### `eth_simulateV1`

दिए गए base block के ऊपर blocks के अनुक्रम को simulate करता है। प्रत्येक block में calls का एक batch होता है: call N को call N-1 के state changes दिखाई देते हैं, और पहले के बाद का प्रत्येक block अपने से पिछले block पर आधारित होता है।

**Params**

1. **Simulation payload** `OBJECT`
   * **blockStateCalls** `ARRAY` of Block state call `OBJECT`: simulate किए जाने वाले blocks का अनुक्रम, क्रम में
     * **blockOverrides** (*optional*) `OBJECT`: इस block में override करने के लिए header fields का सेट
       * **number** (*optional*) `STRING`: hex, block number को override करता है
       * **difficulty** (*optional*) `STRING`: hex, block difficulty को override करता है
       * **time** (*optional*) `STRING`: hex, block timestamp को override करता है
       * **gasLimit** (*optional*) `STRING`: hex, gas limit को override करता है
       * **coinbase** (*optional*) `STRING`: hex, block miner को override करता है
       * **random** (*optional*) `STRING`: hex, उस value को override करता है जो PREVRANDAO opcode में फ़ीड होता है
       * **baseFee** (*optional*) `STRING`: hex, block base fee को override करता है
       * **excessBlobGas** (*optional*) `STRING`: hex, excess blob gas को override करता है
       * **blobGasUsed** (*optional*) `STRING`: hex, उपयोग की गई blob gas को override करता है
     * **stateOverrides** (*optional*) `MAP`: एक अकाउंट (address) से override विनिर्देश तक मैपिंग। State overrides को **पहली** block entry पर सेट करें; [Tenderly-विशिष्ट व्यवहार](#tenderly-विशिष्ट-व्यवहार) देखें
       * **key** `STRING`: वह अकाउंट जिस पर यह override लागू होता है
       * **value** `OBJECT`: override विनिर्देश
         * **balance** (*optional*) `STRING`: अकाउंट के लिए hex encoded balance override wei में
         * **nonce** (*optional*) `STRING`: अकाउंट के लिए hex encoded nonce override
         * **code** (*optional*) `STRING`: अकाउंट के लिए code override का डेटा
         * **stateDiff** (*optional*) `MAP`: storage key की storage value override में मैपिंग
           * **key** `STRING`: storage key
           * **value** `STRING`: दिए गए storage key के लिए value override
     * **calls** `ARRAY` of Transaction call `OBJECT`: क्रम में निष्पादित; प्रत्येक call को अपने से पहले की calls के state changes दिखाई देते हैं
       * **from** (*optional*) `STRING`: hex encoded address; डिफ़ॉल्ट रूप से zero address
       * **to** (*optional*) `STRING`: hex encoded address
       * **gas** (*optional*) `STRING`: call के लिए hex encoded gas limit
       * **gasPrice** (*optional*) `STRING`: hex, gas मूल्य जो प्रेषक द्वारा भुगतान किया जाना है wei में
       * **maxFeePerGas** (*optional*) `STRING`: hex, प्रति gas अधिकतम कुल शुल्क जो प्रेषक भुगतान करने को तैयार है (नेटवर्क / base fee और miner / priority fee शामिल है) wei में
       * **maxPriorityFeePerGas** (*optional*) `STRING`: hex, प्रति gas अधिकतम शुल्क जो प्रेषक miners को भुगतान करने को तैयार है wei में
       * **value** (*optional*) `STRING`: hex encoded value wei में; डिफ़ॉल्ट रूप से `0x0`
       * **input** (*optional*) `STRING`: hex encoded call data; `data` को deprecated alias के रूप में स्वीकार किया जाता है, और दोनों सेट होने पर `input` को प्राथमिकता मिलती है
       * **nonce** (*optional*) `STRING`: hex encoded nonce
       * **type** (*optional*) `STRING`: hex encoded transaction प्रकार
       * **accessList** (*optional*) `ARRAY` of Access list entry `OBJECT`
         * **address** `STRING`: hex encoded address
         * **storageKeys** `ARRAY` of `STRING`: representation of 32 byte hex encoded storage keys
       * **maxFeePerBlobGas** (*optional*) `STRING`: hex, प्रति blob gas अधिकतम शुल्क wei में
       * **blobVersionedHashes** (*optional*) `ARRAY` of `STRING`: 32 byte hex encoded blob versioned hashes
       * **authorizationList** (*optional*) `ARRAY`: EIP-7702 authorization tuples
   * **returnFullTransactions** (*optional*) `BOOLEAN`: जब `true` हो, तो result blocks में transaction hashes के बजाय पूर्ण transaction objects होते हैं
2. **Base block number** (*optional*) वह block जिसके ऊपर simulation चलता है। डिफ़ॉल्ट रूप से `latest`। या तो:
   * `STRING` Block number
   * `ENUM` of Block tag `earliest|finalized|safe|latest|pending`

**Example**

यह request दो blocks को simulate करता है। पहला block state override के साथ एक प्रेषक को fund करता है, फिर ETH भेजता है और 1 ETH को WETH में wrap करता है; दूसरा block एक कस्टम timestamp सेट करता है और पहले block में mint किए गए WETH को transfer करता है।

<Tabs>
  <Tab title="Request">
    ```json title="example.json" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
    {
      "id": 0,
      "jsonrpc": "2.0",
      "method": "eth_simulateV1",
      "params": [
        {
          "blockStateCalls": [
            {
              "stateOverrides": {
                "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2": {
                  "balance": "0x3635c9adc5dea00000"
                }
              },
              "calls": [
                {
                  "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
                  "to": "0x1111111111111111111111111111111111111111",
                  "value": "0x1bc16d674ec80000"
                },
                {
                  "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
                  "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "value": "0xde0b6b3a7640000",
                  "input": "0xd0e30db0"
                }
              ]
            },
            {
              "blockOverrides": { "time": "0x6ae00000" },
              "calls": [
                {
                  "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
                  "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "input": "0xa9059cbb00000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000de0b6b3a7640000"
                }
              ]
            }
          ]
        },
        "latest"
      ]
    }
    ```
  </Tab>

  <Tab title="Shell">
    ```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": "eth_simulateV1",
    "params": [
    {
    "blockStateCalls": [
      {
        "stateOverrides": {
          "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2": {
            "balance": "0x3635c9adc5dea00000"
          }
        },
        "calls": [
          {
            "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
            "to": "0x1111111111111111111111111111111111111111",
            "value": "0x1bc16d674ec80000"
          },
          {
            "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
            "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "value": "0xde0b6b3a7640000",
            "input": "0xd0e30db0"
          }
        ]
      },
      {
        "blockOverrides": { "time": "0x6ae00000" },
        "calls": [
          {
            "from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
            "to": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
            "input": "0xa9059cbb00000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000de0b6b3a7640000"
          }
        ]
      }
    ]
    },
    "latest"
    ]
    }'
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript title="example.js" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
    // Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
    const { ethers } = require('ethers');

    async function runSimulateV1() {
    // Initialize an ethers instance
    const provider = new ethers.providers.JsonRpcProvider(
    'https://mainnet.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY',
    );

    // Execute method
    const result = await provider.send('eth_simulateV1', [
    {
    blockStateCalls: [
      {
        stateOverrides: {
          '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2': {
            balance: '0x3635c9adc5dea00000',
          },
        },
        calls: [
          {
            from: '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2',
            to: '0x1111111111111111111111111111111111111111',
            value: '0x1bc16d674ec80000',
          },
          {
            from: '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2',
            to: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
            value: '0xde0b6b3a7640000',
            input: '0xd0e30db0',
          },
        ],
      },
      {
        blockOverrides: { time: '0x6ae00000' },
        calls: [
          {
            from: '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2',
            to: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
            input: '0xa9059cbb00000000000000000000000011111111111111111111111111111111111111110000000000000000000000000000000000000000000000000de0b6b3a7640000',
          },
        ],
      },
    ],
    },
    'latest',
    ]);

    // Print the output to console
    console.log(result);
    }

    (async () => {
    runSimulateV1();
    })();
    ```
  </Tab>

  <Tab title="Response">
    ```json title="response.json" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
    {
      "id": 0,
      "jsonrpc": "2.0",
      "result": [
        {
          "number": "0x184b35b",
          "hash": "0x2b33857d4b0380d7b92a258c77d9357c9515701f914684789e959ae84d73347a",
          "parentHash": "0x1fe7faf7d5b3a57fe52192bcf634b62bda8cfd39a5509d5541a2fb30d5438463",
          "nonce": "0x88425305eb52b6f7",
          "mixHash": "0x5bf018c82ca9e0e3805b00475afe61be2b1077eff79abb6cb4617af8548aa514",
          "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
          "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "miner": "0x4838b106fce9647bdf1e7877bf73ce8b0bad5f97",
          "difficulty": "0x0",
          "extraData": "0x546974616e2028746974616e6275696c6465722e78797a29",
          "size": "0x0",
          "gasLimit": "0x3938700",
          "gasUsed": "0x3938700",
          "timestamp": "0x6a4bb197",
          "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "baseFeePerGas": "0x18d7ee41",
          "blobGasUsed": "0x60000",
          "excessBlobGas": "0xba42085",
          "uncles": [],
          "transactions": [
            "0xbb42f5dcbfa507c52b64642c9b9e2a95fc4e2542cbd06b180239367d45f35e30",
            "0xcb06f645c2962f5dfff047efb2a000d05d0a58a619c63c97ec3e12cf48d02033"
          ],
          "calls": [
            {
              "returnData": "0x",
              "logs": [],
              "gasUsed": "0x5208",
              "status": "0x1"
            },
            {
              "returnData": "0x",
              "logs": [
                {
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "topics": [
                    "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c",
                    "0x000000000000000000000000e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2"
                  ],
                  "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
                  "blockNumber": "0x184b35b",
                  "transactionHash": "0xcb06f645c2962f5dfff047efb2a000d05d0a58a619c63c97ec3e12cf48d02033",
                  "transactionIndex": "0x1",
                  "blockHash": "0x2b33857d4b0380d7b92a258c77d9357c9515701f914684789e959ae84d73347a",
                  "logIndex": "0x0",
                  "removed": false
                }
              ],
              "gasUsed": "0xafee",
              "status": "0x1"
            }
          ]
        },
        {
          "number": "0x184b35c",
          "hash": "0xddb8a8a01c753b30acea4c8a12e36f3157dfa854ad0134b1dbb1e6227a9838cd",
          "parentHash": "0x2b33857d4b0380d7b92a258c77d9357c9515701f914684789e959ae84d73347a",
          "nonce": "0x0000000000000000",
          "mixHash": "0x5bf018c82ca9e0e3805b00475afe61be2b1077eff79abb6cb4617af8548aa514",
          "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
          "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
          "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "miner": "0x0000000000000000000000000000000000000000",
          "difficulty": "0x0",
          "extraData": "0x546974616e2028746974616e6275696c6465722e78797a29",
          "size": "0x18e",
          "gasLimit": "0x3938700",
          "gasUsed": "0x0",
          "timestamp": "0x6ae00000",
          "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
          "baseFeePerGas": "0x1bf2ec09",
          "excessBlobGas": "0xba62085",
          "uncles": [],
          "transactions": [
            "0x21ac69b18844a9f1345c2b29292852477672178b0d338092f20dcb850d261604"
          ],
          "calls": [
            {
              "returnData": "0x0000000000000000000000000000000000000000000000000000000000000001",
              "logs": [
                {
                  "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                  "topics": [
                    "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                    "0x000000000000000000000000e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
                    "0x0000000000000000000000001111111111111111111111111111111111111111"
                  ],
                  "data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
                  "blockNumber": "0x184b35b",
                  "transactionHash": "0x21ac69b18844a9f1345c2b29292852477672178b0d338092f20dcb850d261604",
                  "transactionIndex": "0x0",
                  "blockHash": "0x2b33857d4b0380d7b92a258c77d9357c9515701f914684789e959ae84d73347a",
                  "logIndex": "0x1",
                  "removed": false
                }
              ],
              "gasUsed": "0x73fe",
              "status": "0x1"
            }
          ]
        }
      ]
    }
    ```
  </Tab>
</Tabs>

**Result**

`ARRAY` of Block result `OBJECT`, प्रत्येक `blockStateCalls` entry के लिए एक, क्रम में। प्रत्येक block result में `eth_getBlockByNumber` द्वारा लौटाए जाने वाले standard block header fields (`number`, `hash`, `parentHash`, `timestamp`, `gasLimit`, `gasUsed`, `baseFeePerGas`, `logsBloom`, `miner`, इत्यादि) के साथ ये भी होते हैं:

* **transactions** `ARRAY`: simulated calls के transaction hashes, या `returnFullTransactions` के `true` होने पर पूर्ण transaction objects
* **calls** `ARRAY` of Call result `OBJECT`, प्रत्येक call के लिए एक, क्रम में:
  * **returnData** `STRING`: call का hex encoded return data
  * **logs** `ARRAY` of Log `OBJECT`: call द्वारा उत्सर्जित events (`address`, `topics`, `data`, `blockNumber`, `transactionHash`, `transactionIndex`, `blockHash`, `logIndex`, `removed`); revert हुई calls के लिए खाली
  * **gasUsed** `STRING`: call द्वारा उपभोग की गई gas की hex encoded मात्रा
  * **status** `STRING`: सफलता के लिए `0x1`, विफलता के लिए `0x0`
  * **error** `OBJECT`: केवल तब मौजूद जब call विफल होती है
    * **code** `NUMBER`: error code
    * **message** `STRING`: error message, उपलब्ध होने पर revert reason सहित

### Tenderly-विशिष्ट व्यवहार

Tenderly का कार्यान्वयन reference [execution-apis](https://github.com/ethereum/execution-apis) विनिर्देश से निम्नलिखित तरीकों से भिन्न है:

* **`validation` समर्थित नहीं है।** `validation: true` सेट करने पर error `validation flag is not supported` लौटता है। Simulation हमेशा non-validating mode में चलता है: calls पर nonce, balance, और fee आवश्यकताएँ लागू नहीं की जातीं।
* **`traceTransfers` समर्थित नहीं है।** `traceTransfers: true` सेट करने पर error `traceTransfers flag is not supported` लौटता है। कोई synthetic ETH transfer logs उत्पन्न नहीं होते।
* **`state` overrides समर्थित नहीं हैं।** State override में `state` field (पूर्ण storage प्रतिस्थापन) `not supported` error लौटाता है। व्यक्तिगत storage slots को override करने के लिए `stateDiff` का उपयोग करें।
* **State overrides पहले block से लागू होते हैं।** `stateOverrides` को पहली `blockStateCalls` entry पर सेट करें; बाद की entries पर `stateOverrides` लागू नहीं किए जाते।
* **प्रति-call `gas` clamp किया जाता है।** Block gas limit और 600,000,000 के योग से अधिक `gas` value अस्वीकार किए जाने के बजाय उस अधिकतम सीमा तक clamp कर दी जाती है।
* **Block या call संख्या की कोई सीमा नहीं।** `blockStateCalls` entries की संख्या या प्रति block calls की संख्या पर कोई लागू अधिकतम सीमा नहीं है।
* **Transaction hashes synthetic हैं।** Result blocks में hashes simulated calls की पहचान करते हैं लेकिन signed transactions के hashes नहीं हैं।
* **Block progression.** पहले के बाद के प्रत्येक simulated block को `number = previous + 1` और पिछले result से chained `parentHash` मिलता है, और base fee तथा gas limit की पुनर्गणना होती है। Auto-generated timestamp node का wall-clock समय होता है, इसलिए जब timestamps महत्वपूर्ण हों तो `blockOverrides.time` स्पष्ट रूप से सेट करें। Override किए गए block numbers और timestamps ज्यों के त्यों लागू किए जाते हैं; monotonicity validate नहीं की जाती। जब पहली block entry `number` के बिना `blockOverrides` देती है, तो block number डिफ़ॉल्ट रूप से base block plus 1 होता है।

### नेटवर्क उपलब्धता

`eth_simulateV1` Node RPC नेटवर्क और Virtual Environments पर उपलब्ध है, निम्नलिखित नेटवर्क को छोड़कर, जहाँ अंतर्निहित network nodes इस मेथड को समर्थन नहीं करते:

* ApeChain
* Avalanche C-Chain
* Avalanche C-Chain Fuji
* Blast
* Curtis
* Flare
* Immutable
* Immutable Testnet
* Lens
* Lens Testnet
* Metis Andromeda
* Metis Sepolia
* Monad
* Monad Testnet
* Moonbase Alpha
* Moonbeam
* Moonriver
* Scroll Mainnet
* Scroll Sepolia
* Sonic
* Sonic Testnet
* Stable
* Stable Testnet
* ZKsync
* ZKsync Sepolia
