Access parties from different participant on Canton cluster

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

2 Likes

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?

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
      }
    }
  }
}

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.

1 Like

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

3 Likes

@Ratko_Veprek

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

3 Likes

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.

1 Like