I am facing the error when I transfer token from one node to another node account in corda. Here first I create account i.e. ACCOUNT1 on PartyA node which is shared with all nodes. Then, I create account with same name which is created in PartyA node i.e. ACCOUNT1 . Now this account is created on another node i.e. PartyB After that i issue some token to PartyA account i.e. ACCOUNT1 and after this process i Transfer token from Party A account to PartyB account i.e. ACCOUNT1 then i get the following error
"java.lang.IllegalArgumentException: Do not provide flow sessions for the local node. FinalityFlow will record the notarised transaction locally."
But when transfer token from one node account to another node account with differernt account names this flow is working fine. So my concern is, can we create account with the same name in different nodes? If yes, then what mistake I have done and one thing if we have 4 nodes and we create same xyz account in all nodes and also share with all nodes. So at the time of transfer how they identify like transfer to which node within the same name ?
You can. Each accountInfo state has unique identifier, the name is just a string variable of the state. You can identify the account by its ID.
You are running into the error because you were query the account by name. And the node went to look Account1 and got the Account1 from PartyA node. If you query use the accountID, it will be fine.