Migrating data from Corda 2 to Corda 3

霸气de小男生 提交于 2019-12-06 11:12:33

问题


https://docs.corda.net/changelog.html#version-3-0 states that "an H2 database instance of Corda 1.0 and 2.0 cannot be reused for Corda 3.0". Does this means that if I have a Cordapp running Corda 2.0 and I want to upgrade my CorDapp to Corda 3.0, I need to discard all my node's stored information from Corda 2.0, start fresh and re-run all the transactions that were processed before accepting new ones?

Let's take an example. I have a Corda 2.0 CorDapp to record cash-in and cash-out. This CorDapp has been operating for a while, with 10k transactions stored in the vault already. And let's say that there are 50 new transactions a day.

Suppose that on March 1st, Alice deposits $30. On March 2nd, Alice withdraws $20. She therefore only has $10 available.

If I want to upgrade my Cordapp to Corda 3.0 on March 14th, I'll need to discard the stored data from my Corda 2.0 Cordapp (persistence.mv.db, etc.) and re-run those 10k transactions in Corda 3.0 before allowing Alice to do any new deposits/withdrawals (since I can't allow Alice to have anything different than $10). Is my understanding correct?


回答1:


That's correct. Corda 1.0 guaranteed API stability (meaning that your CorDapps will not break from one release of Corda to the next), but it did not guarantee wire stability. This means that data created using Corda 2.0 or earlier will not necessarily be readable by Corda 3.0.

Corda 3.0 does guarantee wire stability, meaning that data created from Corda 3.0 onwards will be readable by future versions, and that nodes running different Corda versions (3.0+) will be able to communicate.

Your best option in migrating from Corda 2.0 to Corda 3.0 is indeed to rerun all the transactions on Corda 3.0, and only run new transactions once that process is complete.



来源:https://stackoverflow.com/questions/49301744/migrating-data-from-corda-2-to-corda-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!