# Simulating transaction execution

**URL:** <https://forum.canton.network/t/simulating-transaction-execution/3463>\
**Category:** App Development\
**Tags:** ledger-api\
**Created:** [November 16, 2021, 6:03pm UTC](https://forum.canton.network/t/simulating-transaction-execution/3463 "2021-11-16T18:03:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulperegud](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/paulperegud/32/770_2.png) [@paulperegud](https://forum.canton.network/u/paulperegud)\
**Post date:** [November 16, 2021, 6:03pm UTC](https://forum.canton.network/t/simulating-transaction-execution/3463/1 "2021-11-16T18:03:52Z")

</div>

Ethereum’s API has eth\_call, which allows to simulate transaction execution without actually submitting transaction to the network. Tendermint’s ABCI has checkTx endpoint where transaction can be executed against current state to check it’s applicability.

Is there anything like that for DAML? Submission API has CreateCommand, ExerciseCommand, ExerciseByKeyCommand, CreateAndExerciseCommand. All of them are writes.

There are scenarios, where you want to know what transaction does before submitting it. Imagine having all of your business logic in DAML and then trying to create a “guard” which will examines if transaction should or should not be submitted. Impossible without replicating business logic outside of DAML.

---

<div class="post-metadata">

**Author:** ![stefanobaghino-da](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stefanobaghino-da/32/7057_2.png) [@stefanobaghino-da](https://forum.canton.network/u/stefanobaghino-da)\
**Post date:** [November 16, 2021, 6:09pm UTC](https://forum.canton.network/t/simulating-transaction-execution/3463/2 "2021-11-16T18:09:42Z")

</div>

That’s an interesting question. What are the properties of a transaction that you would like to inspect that you could not cover with an `abort` or an `ensure` in your contract construction or exercising logic?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [November 16, 2021, 6:25pm UTC](https://forum.canton.network/t/simulating-transaction-execution/3463/3 "2021-11-16T18:25:44Z")

</div>

Depending on what exactly you want to do [Daml exceptions](https://docs.daml.com/daml/intro/8_Exceptions.html) might be worth looking into: You can wrap the part that you want to test out in a `try` and run the checks at the end and then throw an exception if the checks fail to rollback everything that happened inside the try and do something else instead.
