How client app can get the correct Package Id to start a trigger using Trigger Service?
I continue with Trigger Service. I started a trigger from Postman.
My payload was:
I got Package Id using:
daml damlc inspect path/to/trigger.dar | head -1
What is the best way for a client application to reach the package id? I see the JSON Api exposes List all Packages but not sure it can help much since it is returning a list…
Can you suggest something here?
The trigger service will return the package ID whenever you upload a new Dar:
You should use that to know how to start your trigger.
Hope this helps,
So I should keep trigger as a separate project to make it “live” in a separate dar.
Then I upload it through Trigger Sevice (not directly to the ledger as usual)
Catch the package id and use it whenever I want to start a new trigger. Right?
But what if there is a time span between dar upload and the new trigger start? I should consider storage for package id in this case, right?
I recommend to use
daml damlc inspect-dar --json path/to/your/dar here.