I am developing a simple Canton app with two participants, let’s say participant1 and participant2. I have one party, call them party0, that I want to be able to exercise choices and create contracts on both participants. I’ve started out by enabling party0 on participant2 like so:
val party0 = participant2.parties.enable("party0")
When I go to exercise a choice on a contract created on participant1 using com.daml:bindings-rxjava:1.14.0, I get an error like the following:
io.grpc.StatusRuntimeException: INVALID_ARGUMENT: MalformedRequest(CN10044-0): Malformed request; message=Confirmation request creation failed, reason=ParticipantAuthorizationError(PAR::participant1::1220891ca686... does not host party0::12204879eef15a1cec6c0ca615479e4e0c487f58840d919ae217fc9d38eb42b2f24d or is not active.)
When I try to authorize party0 on participant1 like so:
The participants are in different identity namespaces, that’s why you get the “Mismatching namespaces” error on your authorization command. You have to split the command into two to authorize both directions of the party to participant mapping.
First participant2 needs to authorize, because that participant owns the party’s namespace:
participant2.identity.party_to_participant_mappings.authorize(IdentityChangeOp.Add, party = party0, participant = participant1.id, side = RequestSide.From)
And then participant1 as the new hosting participant has to also authorize the other direction of the mapping:
participant1.identity.party_to_participant_mappings.authorize(IdentityChangeOp.Add, party = party0, participant = participant1.id, side = RequestSide.To)
Be aware that multi-participant parties have to be setup before any transactions for that party are processed. The feature to migrate an existing party with contracts from one participant to another does not exist yet.
Thanks so much for your response @soren ! That looks straightforward enough. I will give this a try and get back to you when I get a chance but it might take a bit because I have competing obligations.