问题
Several questions on Corda deployment:
Upon deployment, do all the JAR files in all Corda nodes have to be exactly the same - same build, same version, same hash, etc.. ? Does it mean all parties have to agree on the same code base beforehand?
How to implement your own node's logic variant? Is it possible to only share the JARs containing interface of the flow and have different JARs for implementation? Can we drop JAR into plugin directory as required without synchronizing with other nodes?
How do the first-time deployment and follow-up code (JAR) updates work for individual node? Please explain the typical deployment steps.
I have read the documentations but still not so clear about real-world production deployment scenario.
回答1:
For 1. and 2.: See https://docs.corda.net/writing-a-cordapp.html#structure. The JARs containing the code for states and contracts must be identical across participants, since everyone must be in consensus about what is being agreed on the ledger and whether a given ledger update is valid. However, the flow logic can vary across nodes. As a result, CorDapps should be split into several JARs - some which will be shared and identical across nodes (contract and state definitions), and some which will be different (flow definitions, possibly other supporting classes)
For 3.: Here are instructions regarding the deployment of a node: https://docs.corda.net/deploying-a-node.html
来源:https://stackoverflow.com/questions/47885339/when-deploying-corda-nodes-across-the-network-which-jars-have-to-be-exactly-the