Skip to content

Commit

Permalink
Added to tracing example commands and updated instructions for using …
Browse files Browse the repository at this point in the history
…external RPC providers
  • Loading branch information
srinjoyc committed Nov 18, 2024
1 parent f3494e3 commit d7e096c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions arbitrum-docs/stylus/how-tos/debugging-stylus-tx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Thread 1 "cargo-stylus" hit Breakpoint 2, stylus_hello_world::Counter::increment
For traditional tracing, `cargo stylus` supports calls to `debug_traceTransaction`. To trace a transaction, you can use the following command:

```sh
cargo stylus trace [OPTIONS] --tx <TX>
cargo stylus trace [OPTIONS] --tx <TX> --use-native-tracer
```

Options:
Expand All @@ -162,7 +162,7 @@ Options:
Run the following command to obtain a trace output:

```sh
cargo stylus trace --tx=$TX_HASH --endpoint=$RPC_URL
cargo stylus trace --tx=$TX_HASH --endpoint=$RPC_URL --use-native-tracer
```

This will produce a trace of the functions called and [ink](https://docs.arbitrum.io/stylus/concepts/stylus-gas#ink-and-gas) left along each method:
Expand All @@ -171,18 +171,7 @@ This will produce a trace of the functions called and [ink](https://docs.arbitru
[{"args":[0,0,0,4],"endInk":846200000,"name":"user_entrypoint","outs":[],"startInk":846200000},{"args":[],"endInk":846167558,"name":"msg_reentrant","outs":[0,0,0,0],"startInk":846175958},{"args":[],"endInk":846047922,"name":"read_args","outs":[208,157,224,138],"startInk":846061362},{"args":[],"endInk":845914924,"name":"msg_value","outs":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"startInk":845928364},{"args":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"endInk":227196069,"name":"storage_load_bytes32","outs":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"startInk":844944549},{"args":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],"endInk":226716083,"name":"storage_cache_bytes32","outs":[],"startInk":226734563},{"args":[0],"endInk":226418732,"name":"storage_flush_cache","outs":[],"startInk":226486805},{"args":[],"endInk":226362319,"name":"write_result","outs":[],"startInk":226403481},{"args":[],"endInk":846200000,"name":"user_returned","outs":[0,0,0,0],"startInk":846200000}]
```

RPC providers can also be used to trace transactions and utilize `debug_traceTransaction` on live networks with the `stylusTracer`. For example:

```
curl -s -X POST -H "Content-Type: application/json" --data '{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": ["<YOUR_TXN_HASH>", {"tracer": "stylusTracer"}],
"id": 1
}' <YOUR_RPC_URL>
```

You can use the Sepolia RPC URL from our our [list](https://docs.arbitrum.io/for-devs/dev-tools-and-resources/chain-info#arbitrum-public-rpc-endpoints) or use an external provider, some that support this are:
RPC providers can also be used to trace transactions and utilize `debug_traceTransaction` on live networks with the `stylusTracer`. Some RPC providers that support Stylus transaction tracing include:

- **[QuickNode](https://www.quicknode.com/)**: Testnet tracing supported on the free tier.
- **[Tenderly](https://tenderly.co/)**: Testnet tracing supported on the free tier.
Expand Down

0 comments on commit d7e096c

Please sign in to comment.