Skip to content
Discussions/App Development/Access parties from different participant on Canton clusterForum ↗

Access parties from different participant on Canton cluster

App Development7 posts570 views10 likesLast activity Dec 2020
RE
relu.seicariuOP
Dec 2020

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" participantName

I 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

CO
cocreature
Dec 2020

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?

RE
relu.seicariu
Dec 2020

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
      }
    }
  }
}
CO
cocreature
Dec 2020

Sorry I didn’t mean make myself clear, I was referring to the participant config you pass to daml script via the --participant-config option.

RA
Ratko_Veprek
Dec 2020

@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")

RE
relu.seicariu
Dec 2020

@Ratko_Veprek

Thanks for the link, is exactly what I needed :).

RA
Ratko_Veprek
Dec 2020

You also might want to look at the deployment/docker example in the Canton distribution. In particular at the file deployment/docker/data/canton/bootstrap.canton (after line 50), regarding how to create JWT tokens and dump party names.

← Back to Discussions