You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor: disable persisting sources.avm.json by default; deprecate `persist_sourcemaps`
* docs: refresh docs
* chore: tweak docs
* chore: pip audit
* chore: bump deprecation version
* chore: updating teal.tok.map to teal.map extension
* fix: set state_change to true in simulate_response method
* chore: removing the # delimeter from trace file names
* chore: remove sources.avm.json generation as part of persist sourcemaps
* fix: filename generation for trace files and add a unit test
Copy file name to clipboardExpand all lines: docs/html/_sources/capabilities/debugger.md.txt
+10-11Lines changed: 10 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ The AlgoKit Python Utilities package provides a set of debugging tools that can
6
6
7
7
The `config.py` file contains the `UpdatableConfig` class which manages and updates configuration settings for the AlgoKit project. The class has the following attributes:
8
8
9
-
- `debug`: Indicates whether debug mode is enabled.
10
-
- `project_root`: The path to the project root directory. Can be ignored if you are using `algokit_utils` inside an `algokit` compliant project (containing `.algokit.toml` file). For non algokit compliant projects, simply provide the path to the folder where you want to store sourcemaps and traces to be used with [`AlgoKit AVM Debugger`](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). Alternatively you can also set the value via the `ALGOKIT_PROJECT_ROOT` environment variable.
11
-
- `trace_all`: Indicates whether to trace all operations. Defaults to false, this means that when debug mode is enabled, any (or all) application client calls performed via `algokit_utils` will store responses from `simulate` endpoint. These files are called traces, and can be used with `AlgoKit AVM Debugger` to debug TEAL source codes, transactions in the atomic group and etc.
12
-
- `trace_buffer_size_mb`: The size of the trace buffer in megabytes. By default uses 256 megabytes. When output folder containing debug trace files exceedes the size, oldest files are removed to optimize for storage consumption.
13
-
- `max_search_depth`: The maximum depth to search for a an `algokit` config file. By default it will traverse at most 10 folders searching for `.algokit.toml` file which will be used to assume algokit compliant project root path.
9
+
- `debug`: Indicates whether debug mode is enabled.
10
+
- `project_root`: The path to the project root directory. Can be ignored if you are using `algokit_utils` inside an `algokit` compliant project (containing `.algokit.toml` file). For non algokit compliant projects, simply provide the path to the folder where you want to store sourcemaps and traces to be used with [`AlgoKit AVM Debugger`](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). Alternatively you can also set the value via the `ALGOKIT_PROJECT_ROOT` environment variable.
11
+
- `trace_all`: Indicates whether to trace all operations. Defaults to false, this means that when debug mode is enabled, any (or all) application client calls performed via `algokit_utils` will store responses from `simulate` endpoint. These files are called traces, and can be used with `AlgoKit AVM Debugger` to debug TEAL source codes, transactions in the atomic group and etc.
12
+
- `trace_buffer_size_mb`: The size of the trace buffer in megabytes. By default uses 256 megabytes. When output folder containing debug trace files exceedes the size, oldest files are removed to optimize for storage consumption.
13
+
- `max_search_depth`: The maximum depth to search for a an `algokit` config file. By default it will traverse at most 10 folders searching for `.algokit.toml` file which will be used to assume algokit compliant project root path.
14
14
15
15
The `configure` method can be used to set these attributes.
16
16
@@ -26,8 +26,7 @@ config.configure(debug=True)
26
26
27
27
Debugging utilities can be used to simplify gathering artifacts to be used with [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) in non algokit compliant projects. The following methods are provided:
28
28
29
-
- `persist_sourcemaps`: This method persists the sourcemaps for the given sources as AVM Debugger compliant artifacts. It takes a list of `PersistSourceMapInput` objects, a `Path` object representing the root directory of the project, an `AlgodClient` object for interacting with the Algorand blockchain, and a boolean indicating whether to dump teal source files along with sourcemaps.
30
-
- `simulate_and_persist_response`: This method simulates the atomic transactions using the provided `AtomicTransactionComposer` object and `AlgodClient` object, and persists the simulation response to an AVM Debugger compliant JSON file. It takes an `AtomicTransactionComposer` object representing the atomic transactions to be simulated and persisted, a `Path` object representing the root directory of the project, an `AlgodClient` object representing the Algorand client, and a float representing the size of the trace buffer in megabytes.
29
+
- `simulate_and_persist_response`: This method simulates the atomic transactions using the provided `AtomicTransactionComposer` object and `AlgodClient` object, and persists the simulation response to an AVM Debugger compliant JSON file. It takes an `AtomicTransactionComposer` object representing the atomic transactions to be simulated and persisted, a `Path` object representing the root directory of the project, an `AlgodClient` object representing the Algorand client, and a float representing the size of the trace buffer in megabytes.
31
30
32
31
### Trace filename format
33
32
@@ -39,8 +38,8 @@ The trace files are named in a specific format to provide useful information abo
39
38
40
39
Where:
41
40
42
-
- `timestamp`: The time when the trace file was created, in ISO 8601 format, with colons and periods removed.
43
-
- `last_round`: The last round when the simulation was performed.
44
-
- `transaction_types`: A string representing the types and counts of transactions in the atomic group. Each transaction type is represented as `${count}#${type}`, and different transaction types are separated by underscores.
41
+
- `timestamp`: The time when the trace file was created, in ISO 8601 format, with colons and periods removed.
42
+
- `last_round`: The last round when the simulation was performed.
43
+
- `transaction_types`: A string representing the types and counts of transactions in the atomic group. Each transaction type is represented as `${count}${type}`, and different transaction types are separated by underscores.
45
44
46
-
For example, a trace file might be named `20220301T123456Z_lr1000_2#pay_1#axfer.trace.avm.json`, indicating that the trace file was created at `2022-03-01T12:34:56Z`, the last round was `1000`, and the atomic group contained 2 payment transactions and 1 asset transfer transaction.
45
+
For example, a trace file might be named `20220301T123456Z_lr1000_2pay_1axfer.trace.avm.json`, indicating that the trace file was created at `2022-03-01T12:34:56Z`, the last round was `1000`, and the atomic group contained 2 payment transactions and 1 asset transfer transaction.
<dd><p>Persist the sourcemaps for the given sources as an AlgoKit AVM Debugger compliant artifacts.
1539
1539
Args:
1540
1540
sources (list[PersistSourceMapInput]): A list of PersistSourceMapInput objects.
1541
1541
project_root (Path): The root directory of the project.
1542
1542
client (AlgodClient): An AlgodClient object for interacting with the Algorand blockchain.
1543
1543
with_sources (bool): If True, it will dump teal source files along with sourcemaps.
1544
-
Default is True, as needed by an AlgoKit AVM debugger.</p>
1544
+
Default is True, as needed by an AlgoKit AVM debugger.
1545
+
persist_mappings (bool): Enables legacy behavior of persisting the <codeclass="docutils literal notranslate"><spanclass="pre">sources.avm.json</span></code> mappings to
1546
+
the project root. Default is False, given that the AlgoKit AVM VSCode extension will manage the mappings.</p>
Copy file name to clipboardExpand all lines: docs/html/capabilities/debugger.html
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,6 @@ <h2>Configuration<a class="headerlink" href="#configuration" title="Permalink to
110
110
<h2>Debugging Utilities<aclass="headerlink" href="#debugging-utilities" title="Permalink to this heading"></a></h2>
111
111
<p>Debugging utilities can be used to simplify gathering artifacts to be used with <aclass="reference external" href="https://github.com/algorandfoundation/algokit-avm-vscode-debugger">AlgoKit AVM Debugger</a> in non algokit compliant projects. The following methods are provided:</p>
112
112
<ulclass="simple">
113
-
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">persist_sourcemaps</span></code>: This method persists the sourcemaps for the given sources as AVM Debugger compliant artifacts. It takes a list of <codeclass="docutils literal notranslate"><spanclass="pre">PersistSourceMapInput</span></code> objects, a <codeclass="docutils literal notranslate"><spanclass="pre">Path</span></code> object representing the root directory of the project, an <codeclass="docutils literal notranslate"><spanclass="pre">AlgodClient</span></code> object for interacting with the Algorand blockchain, and a boolean indicating whether to dump teal source files along with sourcemaps.</p></li>
114
113
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">simulate_and_persist_response</span></code>: This method simulates the atomic transactions using the provided <codeclass="docutils literal notranslate"><spanclass="pre">AtomicTransactionComposer</span></code> object and <codeclass="docutils literal notranslate"><spanclass="pre">AlgodClient</span></code> object, and persists the simulation response to an AVM Debugger compliant JSON file. It takes an <codeclass="docutils literal notranslate"><spanclass="pre">AtomicTransactionComposer</span></code> object representing the atomic transactions to be simulated and persisted, a <codeclass="docutils literal notranslate"><spanclass="pre">Path</span></code> object representing the root directory of the project, an <codeclass="docutils literal notranslate"><spanclass="pre">AlgodClient</span></code> object representing the Algorand client, and a float representing the size of the trace buffer in megabytes.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">timestamp</span></code>: The time when the trace file was created, in ISO 8601 format, with colons and periods removed.</p></li>
125
124
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">last_round</span></code>: The last round when the simulation was performed.</p></li>
126
-
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">transaction_types</span></code>: A string representing the types and counts of transactions in the atomic group. Each transaction type is represented as <codeclass="docutils literal notranslate"><spanclass="pre">${count}#${type}</span></code>, and different transaction types are separated by underscores.</p></li>
125
+
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">transaction_types</span></code>: A string representing the types and counts of transactions in the atomic group. Each transaction type is represented as <codeclass="docutils literal notranslate"><spanclass="pre">${count}${type}</span></code>, and different transaction types are separated by underscores.</p></li>
127
126
</ul>
128
-
<p>For example, a trace file might be named <codeclass="docutils literal notranslate"><spanclass="pre">20220301T123456Z_lr1000_2#pay_1#axfer.trace.avm.json</span></code>, indicating that the trace file was created at <codeclass="docutils literal notranslate"><spanclass="pre">2022-03-01T12:34:56Z</span></code>, the last round was <codeclass="docutils literal notranslate"><spanclass="pre">1000</span></code>, and the atomic group contained 2 payment transactions and 1 asset transfer transaction.</p>
127
+
<p>For example, a trace file might be named <codeclass="docutils literal notranslate"><spanclass="pre">20220301T123456Z_lr1000_2pay_1axfer.trace.avm.json</span></code>, indicating that the trace file was created at <codeclass="docutils literal notranslate"><spanclass="pre">2022-03-01T12:34:56Z</span></code>, the last round was <codeclass="docutils literal notranslate"><spanclass="pre">1000</span></code>, and the atomic group contained 2 payment transactions and 1 asset transfer transaction.</p>
0 commit comments