Loading documentation…
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).
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 }]
}'| Position | Name | Type | Notes |
|---|---|---|---|
0 | transaction | string | Serialized transaction (signing optional unless sigVerify is set). |
1 | config | object | Optional. Fields below. |
| Field | Type | Notes |
|---|---|---|
encoding | string | base64 (recommended) or base58. |
commitment | string | Bank state to simulate against. |
sigVerify | bool | Verify signatures. Cannot be used with replaceRecentBlockhash. |
replaceRecentBlockhash | bool | Swap in a fresh blockhash before simulating - avoids "blockhash not found". |
accounts | object | { addresses, encoding } to return post-simulation account state. |
{
"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
}
}
}| Field | Meaning |
|---|---|
err | null on success; otherwise the on-chain error the transaction would hit. |
logs | Program log lines - the fastest way to debug a failing instruction. |
unitsConsumed | Compute units used - size your compute-unit limit from this. |
returnData | Program return data, if any. |