This subcommand reads an AIR script from standard input and prints it in human-readable Python-like representation. This representation cannot be executed and is intended to be read by mere mortals.
+ `--call-results PATH` parameter allows you to provide call results for current execution.
+ `--max-heap-size N` defines maximum heap size for WASM runtime.
+ `--interpreter PATH` option defines the AquaVM WASM binary to be executed. By default, it is "target/wasm32-wasi/release/air_interpreter_server.wasm", but you can define a global value with the `AIR_INTERPRETER_WASM_PATH` environment variable. The default presumes that the tool is run from the root of this repository. Feel free to use option or environment variable to run from any location.
+ with the `--json` option, tracing info is output (to stderr) in machine-readable JSON format. The output can be later processed with `air stats` subcommand.
+ `--tracing-params` defines tracing logging levels for AquaVM. By default, it is equal to `info` and does trace the most high-level AquaVM constructions (data parsing, AIR script parsing, execution). With `debug` level it traces some individual commands, and with `trace` level it traces even more fine grained functionality, but it induce more overhead.
+ `--runner-tracing-params` defines tracing logging level for the runner. By default, it is equal to `warn`.
The important option is the execution mode `--native`. It runs the AquaVM as the native code that can be profiled with any native profiler. As input data deserialization and serialization time can be comparable to particle execution time, and short execution times provides less reliable results, one can use `--repeat N` option to repeat particle execution several times. Execution result is not printed in this case, so you may run `--repeat 1` to suppress it.
Another alternative execution mode is `--near`, enabled by with `near` feature flag. It runs a NEAR contract defined by the `--near-contract` option, measuring its gas consumption. The `workspaces` crate in sandbox mode is used for the most accurate NEAR gas measurement. The workspaces build script installs NEAR Sandbox automatically, but on the other machines you have to install it manually and set the NEAR_SANDBOX_BIN_PATH variable.
In the `--plain` mode, the parameters like AIR script path, data path, previous data path and other particle fields can be provided in separate arguments (all of them are optional, and AIR script is read from stdin by default).
Please, note that currently tracing outputs to stdout, and execution result is also printed to stdout. You may suppress printing the result with `air run --repeat 1` option.
Unless you intend to run AIR in native mode, you will need a AIR interpreter build in WASM. You can build it with the `marine` tool. Run following command in the repo's root directory:
It will output the binary to default `--interpreter` path at `target/wasm32-wasi/release/air_interpreter_server.wasm`; if you wish to run the `air` from arbitrary place, store the `air_interpreter_server.wasm` binary in a cool dry place and either set `AIR_INTERPRETER_WASM_PATH` variable or use the `--interpreter` common option of `air run`.