How do I run a scenario in vscode

Hi @magzupao, welcome to the forum!

Scenarios are run automatically in VSCode. For any defnition of type Scenario a (for some type a) you will see a “Scenario results” codelens. One you click on that, a separate tab opens that displays the ledger state at the end of the scenario. Here are two screenshots that display both the link as well as the resulting tab once you click it:

Note that for new applications, I would recommend DAML Script instead of scenarios. Scenario vs Script - #3 by cocreature describes the advantages. The only difference here is that the link will be called “Script results” and the syntax for a DAML Script looks a bit different than scenarios.

You can find more information on scenarios and DAML Script and how you can inspect the results in DAML Studio in our documentation.

2 Likes