在Corda中重新部署节点后,如何在H2数据库中保留数据? [英] How to persist data in H2 Database after node redeployment in Corda?
问题描述
我想在Node Deployment之后将数据保留在Corda H2数据库中.当我再次重新部署节点时,数据就消失了.即使在节点中进行更改并部署它们之后,我的数据仍然可以保持持久吗?
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 ?
推荐答案
每次运行 gradlew deployNodes
时,将删除并重新创建节点文件夹,从而删除数据.但是,不需要不断地重新部署节点.
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.
如果要更改节点的配置,只需编辑节点的 node.conf
文件,如下所示:
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.
如果要更改CorDapp,可以执行以下操作:
If you want to make changes to your CorDapp, you can do the following:
- 对CorDapp的代码进行必要的更改
- 从CorDapp项目的根目录运行
gradlew jar
为您的CorDapp创建更新的JAR - 将新的CorDapp JAR从
build/libs
文件夹复制到每个节点的plugins
/cordapps
文件夹 - 重新启动节点的Java进程
- Make the required changes to your CorDapp's code
- Run
gradlew jar
from the root of your CorDapp project to create an updated JAR for your CorDapp - Copy the new CorDapp JAR from the
build/libs
folder to each node'splugins
/cordapps
folder - Restarting the node's Java process
这篇关于在Corda中重新部署节点后,如何在H2数据库中保留数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!