kiattchaip
kiattchaip

Reputation: 13

How to sync states from other nodes

I follow the steps on the QuickStart topic and try the cordapp-example. However, I has a question and this is my scenario.

  1. Start the cordapp-example network.
  2. Open a browser and access to PartyA node.
  3. Send an IOU from PartyA to PartyB.
  4. Close the cordapp-example network.
  5. Make a copy of a …/cordapp-example/kotlin-source/build/nodes/PartyB and keep it somewhere.
  6. Repeat the step 1-4. (Both PartyA and PartyB now have 2 IOU states in their ledgers).
  7. Replace the …/cordapp-example/kotlin-source/build/nodes/PartyB with the copy one from the step5.

After this point, if I start the cordapp-example network and access to PartyA and PartyB, I will see that PartyA has 2 IOU states but PartyB has only 1 IOU state. I am not sure what I need to do in order to sync the missing IOU state from the PartyA to PartyB.

Upvotes: 1

Views: 459

Answers (2)

Sri Y
Sri Y

Reputation: 1

I have a similar scenario, during the flow's Broadcasting step, it waits indefinitely if the other Party is offline. Can we do this as an asynchronous process where the Broadcast can initiate sending the state/transaction and commit the transaction in current node. The other Party can receive the states as and when it comes online.

I have also posted it here - Corda: Synchronize multiple Nodes that represent same Party

Upvotes: 0

Richard Green
Richard Green

Reputation: 2062

So what is important to understand here is that there is no synchronisation feature as the states are kept in sync as the nodes transact during the flow process; what you have effectively done here is delete and amend your view of the world.

Corda isn't a public blockchain like bitcoin or ethereum; each actor's view of the ledger is subjective, so if you delete or lose your data, you won't be able to restore it from the other parties. If you think about this commercially, why would another actor have any incentive to give help you restore this data? Keeping your data safe is just one of the responsibilities you have when you are transacting in the commercial world.

I wrote a short blog piece about data husbandry here : https://www.corda.net/2017/05/corda-system-failures-data-needs-look-stuff-things-go-wrong/

Upvotes: 2

Related Questions