0
votes

We are building a POC using Corda 4 and Springboot web server.

The POC is running in dev mode in our local network.

The CorDapp developed for POC has four nodes -

  1. Provider Node
  2. Consumer 1 Node
  3. Consumer 2 Node
  4. Notary Node

There are three states-

  1. State 1: NEW
  2. State 2: APPROVED
  3. State 3: CANCELLED

Every deal that takes place between the three nodes have three flows. Following are the three flows and the states:

Flow 1: Provider Node --> Consumer 1 Node

Change State : NEW

Flow 2: Consumer 1 Node --> Consumer 2 Node and Provider Node

Change State : NEW --> APPROVED

Flow 3: Consumer 2 Node -- > Consumer 1 Node and Provider Node

State : APPROVED ---> CANCELLED

Many flows have been initiated in the CorDapp and most of them are in "APPROVED" state.

Due to new requirement, we had to change the flow definitions minutely. After changing, we created the updated CorDapp version and distributed to the four nodes.

After starting the nodes and CorDapp application, we found that the flows that are in "APPROVED" state cannot be started to change the state to "CANCELLED".

The flows are throwing error -

"The Initiator of CollectSignaturesFlow must pass in exactly the sessions required to sign the transaction."

Please note that the we are using all the correct sessions.

Question: How to update the Cordapp and continue old flows till "CANCELLED" state from "APPROVED"?

1
can you confirm that your new flows are backwards compatible. See here-> docs.corda.net/docs/corda-os/4.6/… - Sneha Damle
Yes, the code 'otherSession.getCounterpartyFlowInfo().flowVersion" returned "1". - devman

1 Answers

1
votes

You didn't specify what the change was but my understanding is that if you change your states you have to run a schema migration. That is most likely the reason you're having this issue.

When in devmode you can pretty much just add the runSchemaMigration=true to your node config.

See example here: https://github.com/corda/cordapp-template-java/blob/release-V4/build.gradle#L103

Here's another resource that might be useful for that :https://www.corda.net/blog/upgrade-to-corda-os-46the-database-migration/