Corda是否支持状态删除方案? [英] Is Corda support state deletion scenario?

查看:34
本文介绍了Corda是否支持状态删除方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在不需要使用某些状态时,corda是否支持状态删除方案(在dev/prod中)因为我在启动节点时遇到异常,例如找不到类异常",所以当我在项目中删除状态类并使用相同的旧持久性文件时,就会发生这种情况.

Is corda support state deletion scenario when don't need to use some state (in both dev/prod) Because I face exception when start node like "class not found exception", It's happen when I delete state class in project and use same old persistence file.

我认为是因为状态类已经插入VAULT_STATES中,并且在启动节点时找不到该类.

I think it because of state class already insert in VAULT_STATES and it can't find that class when start node.

我希望有一些提供状态删除的方法.

I expect to have some method that provide state deletion.

更多信息在开发方面,我删除了持久性文件,它当然可以工作,但是我只担心生产方面.

More info In Dev side I delete persistence file and of course it's work, but I just worry about Production side.

推荐答案

从Corda 3开始,如果节点将状态作为事务的一部分存储在其事务存储或保管库中,则该节点需要保留该状态类定义在其类路径上永久存在.

As of Corda 3, if a node has a state stored as part of a transaction in its transaction storage or in its vault, the node needs to keep the state's class definition on its classpath permanently.

您可以直接通过节点的数据库直接删除旧的事务和状态,但前提是事务解析不需要该事务.您可以通过删除节点数据库中 NODE_TRANSACTIONS VAULT_STATES 表中的行以及州模式所定义的任何自定义表(如果它是QueryableState ).但是,如果以后需要将已删除的事务作为事务解决方案的一部分,则您的节点将抛出错误.

You can delete old transactions and states directly via the node's database, but only if the transactions are not required for transaction resolution. You would do this by dropping rows from the NODE_TRANSACTIONS and VAULT_STATES tables in the node's database (as well as any custom tables defined by the state's schemas if it is a QueryableState). However, if the deleted transactions are later required as part of transaction resolution, your node will throw an error.

Corda的未来版本可能提供删除旧的或非当前"状态和事务的机制.您可以在此处找到有关此过程的讨论: https://groups.io/g/corda-dev/topic/20405353 .

Future versions of Corda may provide a mechanism to delete old or "non-current" states and transactions. You can find a discussion of what this process may look like here: https://groups.io/g/corda-dev/topic/20405353.

这篇关于Corda是否支持状态删除方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆