simulateTransaction

Dry-run a Solana transaction over rpc edge to get logs, compute units, and errors before sending.

simulateTransaction runs a transaction against the current bank without submitting it. Use it to catch errors, read program logs, and measure compute-unit usage before you spend a fee. On shared plans it has its own safety limits (see rate limits).

Request

curl -s https://rpc.rpcedge.com \
  -H 'content-type: application/json' \
  -H 'x-api-key: YOUR_UUID_KEY' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "simulateTransaction",
    "params": ["<base64-encoded-tx>", { "encoding": "base64", "commitment": "processed", "replaceRecentBlockhash": true }]
  }'

Parameters

PositionNameTypeNotes
0transactionstringSerialized transaction (signing optional unless sigVerify is set).
1configobjectOptional. Fields below.
FieldTypeNotes
encodingstringbase64 (recommended) or base58.
commitmentstringBank state to simulate against.
sigVerifyboolVerify signatures. Cannot be used with replaceRecentBlockhash.
replaceRecentBlockhashboolSwap in a fresh blockhash before simulating - avoids "blockhash not found".
accountsobject{ addresses, encoding } to return post-simulation account state.

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": { "slot": 429641447 },
    "value": {
      "err": null,
      "logs": ["Program 11111111111111111111111111111111 invoke [1]", "Program ... success"],
      "unitsConsumed": 4821,
      "accounts": null,
      "returnData": null
    }
  }
}
FieldMeaning
errnull on success; otherwise the on-chain error the transaction would hit.
logsProgram log lines - the fastest way to debug a failing instruction.
unitsConsumedCompute units used - size your compute-unit limit from this.
returnDataProgram return data, if any.
simulateTransaction · rpc edge docs