Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API method #1677

Merged
merged 10 commits into from
Sep 6, 2024
62 changes: 62 additions & 0 deletions docs/private-networks/reference/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,68 @@ curl -X POST --data '{"jsonrpc": "2.0","method": "priv_newFilter","params": ["4r
}
```

</TabItem>
</Tabs>

### `priv_traceTransaction`

Provides a [transaction trace](../../../public-networks/reference/api#trace_transaction) for a private transaction.

#### Parameters
- `transactionHash`: _string_ - the hash of the private transaction to trace.
- `privacyGroupId`: _string_ - the privacy group ID associated with the transaction
joaniefromtheblock marked this conversation as resolved.
Show resolved Hide resolved
- `options`: _object_ - request options object with the following fields (all optional and default to `false`).
joaniefromtheblock marked this conversation as resolved.
Show resolved Hide resolved
- `disableStorage`: _boolean_ - `true` disables storage capture.
- `disableMemory`: _boolean_ - `true` disables memory capture.
- `disableStack`: _boolean_ - `true` disables stack capture.

#### Returns
`result`: _array_ of _objects_ - list of [calls to other contracts](../../../public-networks/reference/trace-types.md#trace) containing one object per call, in the order called by the transaction;
if revert reason is enabled with [`--revert-reason-enabled`](../../../public-networks/reference/cli/options.md#revert-reason-enabled), the returned list items include the [revert reason](../../how-to/send-transactions/revert-reason.md).

<Tabs>

<TabItem value="curl HTTP request" label="curl HTTP request" default>

```bash
curl -X POST --data '{"jsonrpc": "2.0", "method": "priv_traceTransaction", "params": ["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"], "id":1}' http://127.0.0.1:8545
joaniefromtheblock marked this conversation as resolved.
Show resolved Hide resolved
```

</TabItem>

<TabItem value="wscat WS request" label="wscat WS request">

```bash
{"jsonrpc":"2.0", "method": "priv_traceTransaction", "params": ["0xf3ab9693ad92e277bf785e1772f29fb1864904bbbe87b0470455ddb082caab9d"], "id":1}
```

</TabItem>

<TabItem value="JSON result" label="JSON result">

```json
joaniefromtheblock marked this conversation as resolved.
Show resolved Hide resolved
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"gas": 21000,
"failed": false,
"returnValue": "",
"structLogs": [
{
"pc": 0,
"op": "PUSH1",
"gas": 4677881,
"gasCost": 3,
"depth": 1,
"stack": [],
"memory": []
},
]
}
}
```

</TabItem>

</Tabs>
Expand Down
Loading