When deploying Corda nodes across the network, which JARs have to be exactly the same?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Deploying Corda nodes across a distributed network is a complex process that requires meticulous attention to ensure all nodes operate harmoniously. One crucial aspect of this setup is the consistency of certain Java ARchive (JAR) files across all nodes. These JARs contain the compiled code that nodes in a Corda network use to execute contracts and flows. Ensuring that specific JARs are identical across all nodes is vital for maintaining the integrity and functionality of the Corda blockchain network.
Importance of Consistent JARs
In Corda, contracts are codified business agreements stored on the blockchain as deterministic code that is run by parties involved in an agreement. If nodes were to run different versions of these contracts, consensus might not be achieved, leading to transaction failures and potentially forking the network. Similarly, consistency in flow frameworks is essential for compatibility and predictability in transaction negotiations.
Which JARs Need to Be Exactly the Same?
There are primarily two types of JARs that need to be identical across all Corda nodes in a network:
- Contract JARs: These contain the contract logic that defines, verifies, and governs how transactions change the states on the ledger. It's crucial that these JARs are consistent across all nodes to ensure that all transactions are verified against the same set of rules.
- Flow JARs: These are responsible for automating the transaction process and providing the necessary steps to propose, verify, and finalize transactions. All parties involved in a transaction must have the exact same flow logic to properly coordinate an agreement.
Technical Explanation and Example
Consider a simple scenario in a Corda network handling IOU (I Owe You) agreements:
- Contract JAR: Contains
IOUContractwhich has averifyfunction ensuring that the IOU's value is non-negative. - Flow JAR: Contains
IOUFlowwhich automates the process of creating, signing, and notarizing an IOU agreement.
If one party's node uses a version of the IOUContract that mistakenly allows negative values, while others do not, transactions proposed by this node would be rejected by other nodes. Similarly, discrepancies in the IOUFlow could prevent nodes from successfully finalizing transactions because they might follow different steps or rules for transaction building and finalization.
Summary Table
Below is a table that summarizes the type of JARs that should be consistent across nodes for effective deployment:
| Type of JAR | Purpose | Consequence of Discrepancy |
| Contract JAR | Defines rules for transaction validity | Transactions might be valid on some nodes but not others. |
| Flow JAR | Automates transaction processes | Nodes may fail to complete transactions correctly. |
Best Practices for JAR Management
To ensure the consistency of these critical JARs across a Corda network, consider the following best practices:
- Version Management: Use consistent versioning and distribution methods for Contract and Flow JARs. Automate checks to verify the version of JARs deployed on each node before network operation.
- Compatibility Testing: Regularly perform compatibility tests on JARs during development to ensure they behave consistently on different nodes.
- Network Parameters: Leverage network parameters to enforce the minimum platform version and the set of accepted contract JARs.
- CICD Pipelines: Implement continuous integration and continuous deployment pipelines to manage JAR updates and ensure uniform distribution and upgrading of JARs across all nodes.
By adhering to these practices, the consistency of deployments across the Corda network can be maintained, thus protecting the network from failures due to inconsistent contract interpretations or transaction processing logic.

