Is there a way to exclude certain packages from ledger after a migration process has been concluded?
For example, if we were to have templates
V2.Foo, deployed from different
.dar's, could we wipe the package that included the first templateId off of the ledger?
Thank you in advance
This is generally not possible in the Daml Ledger model, because a
V1.Foo continues to be part of the chain of transactions that led to the creation of the associated
V2.Foo. Even archived contracts must have their associated dars in order to remain valid.
I can imagine a number of (nonexistent) features that would satisfy various motivations (i.e. “why, not how”). Hiding package IDs from JSON API, withdrawing permission to create new contracts for particular templates, and so on. In this case, what would your motivation be?
In this particular context, I believe that simply hiding “replaced” packages would suffice, in order for the packageId of the template not having to be explicitly known, at the time of a request.
Assuming what you have in mind is JSON-API specific, I created an issue for further discussion of that feature idea. Please subscribe to it for any updates in the future.
I should add that, for production applications, we strongly encourage using the package IDs with JSON API; package ID inference is great for prototyping, but masks potential version mismatches in production, which is why all codegens use explicit package ID specification.