问题
I want to persist data in Corda H2 database after Node Deployment . The data got wiped out when I redeploy the nodes again . Is there any way that my data got persistent even after I make changes in my node and deploy them ?
回答1:
Every time you run gradlew deployNodes, the node folders will be deleted and re-created, removing your data. However, there is no need to constantly re-deploy the nodes.
If you want to make changes to your nodes' configuration, simply edit the nodes' node.conf files, as described here: https://docs.corda.net/corda-configuration-file.html.
If you want to make changes to your CorDapp, you can do the following:
- Make the required changes to your CorDapp's code
- Run
gradlew jarfrom the root of your CorDapp project to create an updated JAR for your CorDapp - Copy the new CorDapp JAR from the
build/libsfolder to each node'splugins/cordappsfolder - Restarting the node's Java process
来源:https://stackoverflow.com/questions/46251932/how-to-persist-data-in-h2-database-after-node-redeployment-in-corda