Debug Trigger on Sandbox

G-d willing

I have 2 DAR files. The first DAR file contains all the contracts of the project. The second DAR file contains a few triggers.
How can I simply debug a trigger on the sandbox, verifying that it is working properly?

Triggers provide off-ledger automation. When you use Daml Sandbox, a trigger must be run as a separate process from the Sandbox. To start a trigger use “daml trigger” command, which needs to be executed in a separate terminal from the one where you run the Sandbox. See the Triggers documentation for details on creating and running triggers, including the parameters you need to pass to “daml trigger” command.
You can also refer to an example in the Wallet Daml Sample App. This app includes 4 triggers. The Readme contains the instructions how to launch the triggers when deploying the app locally and running it against Daml Sandbox.
To debug your trigger code you can use familiar debug” and “trace” functions throughout the trigger code. The output of the “debug” and “trace” functions is printed to stdout and can be viewed in the console that runs the trigger process.

1 Like