简体   繁体   English

我们可以限制 Corda 中的帐户只接受一个特定的 state 吗?

[英]Can we restrict an account in Corda to accept only one specific state?

In My Corda project, I want to create a special account which can have only one specific type of state and do not accept if any other state is shared with it.在我的 Corda 项目中,我想创建一个特殊帐户,该帐户只能具有一种特定类型的 state,并且如果与它共享任何其他 state,则不接受。 While other accounts on the same node can accept other states too.而同一节点上的其他帐户也可以接受其他状态。 Is that possible in Corda.在 Corda 有可能吗? If yes, then How?如果是,那么如何?

you could do this a bunch of different ways.你可以用很多不同的方式来做到这一点。

Maybe the easiest way would be in the flow?也许最简单的方法是在流程中? You just want to create a rule that ensures only a certain account can run or have a flow run involving it.您只想创建一个规则,以确保只有某个帐户可以运行或让流程运行涉及它。

Example:例子:

// Create account by using sub flow (from inside a flow).
val accountInfo: StateAndRef<AccountInfo> = subFlow(CreateAccount("Roger's account"))
// Then look up the account by account ID and name.
accountService.accountInfo(accountInfo.state.data.name)
accountService.accountInfo(accountInfo.state.data.identifier.id)

Take a look at this link for the source docs.查看源文档的此链接。 Good luck!祝你好运!

https://github.com/corda/accounts/blob/master/docs.md https://github.com/corda/accounts/blob/master/docs.md

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我们可以检查科尔达州的双重创建状态吗? - Can we check double creation of a state in Corda? 在 corda 中检索特定的 state - Retrieving a specific state in corda 有什么办法可以让区块链上的特定信息只能被一个特定的账户查询? - Is there any way to make a specific information on blockchain can only be queried by one specific account? 仅将函数访问限制为 Solidity 中的另一个特定合约 - Restrict function access ONLY to one other specific contract in Solidity Corda - 状态大小信息 - Corda - State size information Corda 事件调度中的可调度状态 - Schedulable State in Corda Event scheduling 有没有办法限制Corda RPC用户可以在其节点的保管库中查看的交易数据? - Is there a way to restrict the transaction data the Corda RPC users can view within their node's vault? 在从 v1 迁移到 v2 期间,我们是否需要执行 DML 命令,例如在 Corda state 架构的 liquibase 脚本中插入? - Do we require to do DML commands like insert in liquibase scripts of Corda state schema during migration from v1 to v2? 从corda中的交易中检索帐户名称 - Retrieving account name from a transaction in corda 动态地将参与者添加到Corda状态? - Dynamically add a participant to corda state?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM