Accepting New Contracts on Ledger without Using Daml Navigator

Referring to Automating an upgrade, you can automate the entire process using Daml Scripts and Triggers, except apparently for the final stage of accepting the UpgradeCarbonCertProposal per each authorised User.

Is it possible to accept these new contracts without using a Web browser and Navigator, relying solely on issued commands using Daml Script or Daml Codegen?

You can definitely issue the commands using a Daml Script, something like

upgradeProposals <- query @UpgradeCarbonCertProposal bob
forA_ upgradeProposals $ \(cid, _) -> do
  submit bob $ exerciseCmd cid Accept

However, things are a bit more complicated in practice: The upgrade process in the docs is driven by Alice, i.e., the issuer of the certs. Alice can create the proposals without any issues. But Alice cannot call the accept choice on behalf of Bob or any other user. So when we’re talking about automation here we’re not talking about Alice running another Daml Script that also calls the accept choice, we’re talking about each user running their own daml script that calls accept choices. Each user will only have to do that once (well maybe once per issuer if you have multiple) so automation does not buy you that much here.

1 Like

Thanks for that. So in theory, it is completely doable which is what I thought, but maybe not worth the effort. I guess if it was a small application with limited users and they were amenable to using Navigator for finalisation, it would make sense to do this manually.

1 Like