Tim Stack
Tim Stack

Reputation: 21

How to update a cordapp in Corda 4?

The network consists of PartyA, PartyB and PartyC - all using version 1 of MyCordapp. PartyA now upgrades to version 2 of MyCordapp, version 2 contains a new Corda state and some new flows. After the upgrade PartyA can't do transactions anymore, because any flow stops at the counterparty with:

TransactionVerificationException$UntrustedAttachmentsException: Attempting to load untrusted transaction attachments

..any flow - not only the new flows introduced in version 2.

According to this guide, the node adminstrators of PartyB and PartyC must upload version 2 of MyCordapp manually, before PartyA can do another transaction. Because of the distributed environment this will never happen at the same time. This conversation addresses the problem, but I don't see a solution.

How is this supposed to work? How to avoid the situation, that PartyA is out of business after upgrading to version 2?

Upvotes: 2

Views: 129

Answers (1)

Peter Li
Peter Li

Reputation: 1032

Starting form Corda 4, we had separated the Contract folder and workflows folder. So technically, CorDapp upgrade has two separated steps, Contract upgrade and flow upgrades. They do not necessarily need to happen at the same time.

Please follow this guide to implement a CorDapp upgrade: https://medium.com/corda/contract-upgrades-and-constraints-in-corda-425055a9a47f

NOTE: When doing an upgrade, you are technically changing the jars which had signed all of your previous transactions. So please follow the above instruction, and dont just change the jars.

Upvotes: 1

Related Questions