I am testing Canton community 0.23.0, and use examples/03 to build a 2-pn-1-domain setup in three AWS EC2 instances. The setup and connection of PN to domain works well.
I’m using the same flow of PaintScenario.sc and do it through Canton REPL.
In participant1, var alice = participant1.parties.enable("Alice")
In participant2, var bob = participant2.parties.enable("Bob") var bank = participant2.parties.enable("Bank")
The question come out that, in participant2, I try to create command (bank issues Iou to alice), where I need to refer to the PartyId of alice. Since alice never appears in participant2, I can’t use alice.toPrim. How can I refer to alice as PartyId from participant2?
In fact Alice is visible in participant2 through participant2.parties.list() but I have no clue how to extract this as a PartyId for alice.
The alice.toPrim turns a Canton party id into a scala ledger client bindings party Scala bindings — Daml SDK 1.13.0 documentation. So that’s just a helper in order to make use of Scala code generation within a Canton console.
In order to get Alice’ party on P2, you have several options. First, you can use list
Possibly a final question following my test: now I need to obtain the active contracts (Iou.Iou Contract and Paint.OfferToPaintHouseByPainter) which were created in P2 (by Bank and Bob, respectively). It is easy when it’s done in one host but similarly, I need to obtain this in P1 in this multi-host setup. I think we have some way to get it back through ledger_api in P1 such that alice can accept the offer.
Sorry that I’m new in this area so just try to learn more. Thanks again for your help.
Thanks @Ratko_Veprek . Reallly appreciate your prompt response. Everything works fine. I can deploy a multi-host setup for examples/01.
At this moment I am more just repeating the example in a multi-host setup. When I’m building something for demonstration, I definitely use the methods you suggested.