0
votes

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. While other accounts on the same node can accept other states too. Is that possible in Corda. If yes, then How?

1

1 Answers

0
votes

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