Access parties from different participant on Canton cluster
- relu.seicariuOP 2
I am trying to access or to create a party in a different participant than the one where the script is run, but i am not able to do so with the following snippet
let participantName = ParticipantName with participantName = "participant2" chouquette <- allocatePartyOn "John" participantNameI also try to get the list of parties from a different participant like below:
p2Parties <- listKnownPartiesOn ParticipantName with participantName = "participant2"Both actions are compiling but no action happens on the participant.
The actions are run against a Canton cluster with 1 domain and 2 participant nodes.
Is anyone that can help me with the above.
Thanks - cocreature
Hi @relu.seicariu, scripts are always run locally not by a participant. The participant name you specify needs to match what you have in your participant config, could you share that with us?
- relu.seicariu
The participant config is like below:
canton { participants { participant2 { storage = ${_shared.storage} storage.database-name = "participant2" admin-api { port = 10022 address = 0.0.0.0 // default value if omitted } ledger-api { port = 10021 address = 0.0.0.0 // default value if omitted } } } } - cocreature 1
Sorry I didn’t mean make myself clear, I was referring to the participant config you pass to
daml scriptvia the--participant-configoption. - Ratko_Veprek 3
@relu.seicariu the way you phrase it “create a party in a different participant than the one where the script is run” sounds to me like you are running the script only against p1.
a participant has no authority over other participants. even more, they are distrusting each other and consider each other as potentially malicious. therefore, p1 can not allocate parties on p2.
you have two options: you either configure daml script to work against multiple participants: https://docs.daml.com/daml-script/index.html#using-daml-script-in-distributed-topologies
or you create the parties directly in the canton console, using the command
participant2.parties.enable("party-hint") - relu.seicariu 3
Thanks for the link, is exactly what I needed :).
- Ratko_Veprek 1
You also might want to look at the
deployment/dockerexample in the Canton distribution. In particular at the filedeployment/docker/data/canton/bootstrap.canton(after line 50), regarding how to create JWT tokens and dump party names.