[英]Can we restrict an account in Corda to accept only one specific state?
在我的 Corda 項目中,我想創建一個特殊帳戶,該帳戶只能具有一種特定類型的 state,並且如果與它共享任何其他 state,則不接受。 而同一節點上的其他帳戶也可以接受其他狀態。 在 Corda 有可能嗎? 如果是,那么如何?
你可以用很多不同的方式來做到這一點。
也許最簡單的方法是在流程中? 您只想創建一個規則,以確保只有某個帳戶可以運行或讓流程運行涉及它。
例子:
// 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)
查看源文檔的此鏈接。 祝你好運!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.