Run script across multiple participant nodes when script is divided into two parts
- kctamOP
Hi team,
I am planning a script which will be used to initialize the ledger in a canton setup (with multiple participant nodes).
Based on my previous experience I use
allocatePartyWithHintOnplus the participant name, and a participant configuration file. This works well.However, for some reason I need to split this script into two parts, and using
--output-fileand--input-fileto “bridge” the parties. How can I obtain the participant node information or specify the participant node information for these parties in this case, as I don’t need to redo theallocatePartyWithHintOnany more?Thanks in advance.
kc
- cocreature
The second script needs to know how the parties are mapped to participants. You can specify that in the
party_participantssection of yourparticipants.jsonfile. E.g., in this example alice is on participant 1 and bob is on participant 2.{ "participants": { "one": {"host": "localhost", "port": 6866, "access_token": "jwt_for_alice", "application_id": "myapp"}, "two": {"host": "localhost", "port": 6865, "access_token": "jwt_for_bob", "application_id": "myapp"} }, "party_participants": {"alice": "one", "bob": "two"} }Take a look at the docs for more details.
- kctam
Thanks @cocreature for your suggestion. Does it mean that I need to create this file manually after running the first script (then I can create the jwt with the right PartyID)? Is it possible to generate this automatically after running the first script? I am comparing the situation that if the scripts were not broken down, everything could be handled well in the daml script.
Thanks again.
kc
- cocreature
There is nothing built in to generate this at this point. You could try writing the config of the second script via
--output-filebut you have to manually define the output here. - kctam
Thanks @cocreature . That’s pretty much what my understanding is.