Question on execution of trigger

In my project there is a separate daml trigger folder. I am doing separate build for daml and daml triggers, once the daml is build, I am exporting the long party id. I am rebuilding the trigger and using the party id to run the triggers. This all works ok.

 daml trigger --wall-clock-time --dar .daml/dist/data-triggers-0.0.1.dar --trigger-name AutoDataFlow:autoDataFlowTrigger --ledger-host localhost --ledger-port 6865 --ledger-party party-6fb4b94d-7879-4f53-9d6b-8a9e6d5d0079::122069bdcea4544278938f3f31034c26c4100dfc0f41d763ea706da15ad272c39765

But each time i need to run the trigger, i need to rebuild and copy the party id(party-6fb4b94d-7879…) to the script. What is the best way to run triggers?

You may want to use Users instead of parties.
Unlike party id, user ids are fully controllable, so you will not need to copy it over.

During the first build, after creating your party, you create a user and associate it to the latter. Then you can run the trigger with --legder-user instead of --ledger-party

1 Like