Skip to content

Commit

Permalink
docs: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Neil Campbell <[email protected]>
  • Loading branch information
aorumbayev and neilcampbell authored Oct 25, 2024
1 parent 2ddf294 commit f03f354
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/capabilities/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Note: `algokit-utils-ts-debug` cannot be used in browser environments. However,

### Subscribe to the `simulate` response event

After setting the `debug` flag to true in the [configuration](#configuration) section, subscribe to the `simulate` response event as follows:
After setting the `debug` flag to true in the [configuration](#configuration) section, subscribe to the `TxnGroupSimulated` event as follows:

```ts
import { AVMTracesEventData, Config, EventType } from '@algorandfoundation/algokit-utils'
Expand All @@ -41,15 +41,14 @@ Config.events.on(EventType.TxnGroupSimulated, (eventData: AVMTracesEventData) =>
})
```

This will output the simulation traces emitted by the `algokit-utils-ts` package. Place this code immediately after the `Config.configure` call to ensure it executes before any transactions are submitted for simulation.
This will output any simulation traces that have been emitted whilst calling your app. Place this code immediately after the `Config.configure` call to ensure it executes before any transactions are submitted for simulation.

### Save simulation trace responses from the browser

With the event handler configured, follow these steps to save simulation trace responses:

1. Open your browser's `Console` tab
2. Submit the transaction
3. Look for the message: `(Optional) Save content to your local file system to use with AlgoKit AVM Debugger`
4. Copy the simulation request `JSON` and save it to a file with the extension `.trace.avm.json`
5. Place the file in the `debug_traces` folder of your AlgoKit contract project
3. Copy the simulation request `JSON` and save it to a file with the extension `.trace.avm.json`
4. Place the file in the `debug_traces` folder of your AlgoKit contract project
- Note: If you're not using an AlgoKit project structure, the extension will present a file picker as long as the trace file is within your VSCode workspace

0 comments on commit f03f354

Please sign in to comment.