Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Accepting New Contracts on Ledger without Using Daml NavigatorForum ↗

Accepting New Contracts on Ledger without Using Daml Navigator

App Development3 posts192 views2 likesLast activity Dec 2022
BE
Ben_MOP
Dec 2022

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?

CO
cocreature
Dec 2022

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.

BE
Ben_M
Dec 2022

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.

← Back to Discussions