I must be doing something wrong. If I add this to the daml.yaml
file, it seems it gets ignored:
sandbox-options:
- --static-time
Running the initialization script.
Exception in thread "main" com.daml.lf.engine.script.ScriptF$FailedCmd: Command setTime failed: setTime is not supported in wallclock mode
Raw command: java -Dlogback.configurationFile=/Users/gyorgybalazsi/.daml/sdk/2.2.0/daml-sdk/script-logback.xml -jar /Users/gyorgybalazsi/.daml/sdk/2.2.0/daml-sdk/daml-sdk.jar script --dar .daml/dist/two-phase-order-of-ops-0.0.1.dar --script-name Test:_2_given_Policy_is_in_Active_status --wall-clock-time --ledger-host localhost --ledger-port 6865
It’s a bit tricky unfortunately, you are running into two different bugs:
-
[BUG] Cannot set Canton sandbox wrapper options via sandbox-options in daml.yaml · Issue #13497 · digital-asset/daml · GitHub
You can work around that by creating a config file with the following contents and then specify -c=canton.conf
in your sandbox options.
canton.participants.sandbox.testing-time.type = monotonic-time
canton.parameters.clock.type = sim-clock
-
[BUG] Cannot override time mode in script-options · Issue #13499 · digital-asset/daml · GitHub
You can also work around this by removing the init-script
line from your daml.yaml
and instead specifying the script via --on-start
.
daml start --on-start 'daml script --dar=.daml/dist/foobar-0.1.0.dar --ledger-host=localhost --ledger-port=6865 --script-name Init:setup --static-time
Obviously having to work around two separate issues just to change the time mode is not great and hopefully this will be fixed soon. I cannot provide a timeline atm unfortunately.
1 Like
Thank you, until the fix I will find a work-around.