Example when Canton User's primaryParty makes a difference?
- WallaceKellyOP
I’m trying to assemble a simple example in which a Canton User’s
primaryPartymakes a difference.For example, in the following script, all three commands are submitted by an
adminuser withNoneprimary party. TheprimaryParty(or lack thereof) makes no difference here:alice <- allocatePartyWithHint "Alice" (PartyIdHint "Alice") bob <- allocatePartyWithHint "Bob" (PartyIdHint "Bob") adminId <- validateUserId "admin" createUser (User adminId None) [CanActAs alice, CanActAs bob] aliceTV <- submitUser adminId do createCmd Asset with issuer = alice owner = alice name = "TV" bobTV <- submitUser adminId do exerciseCmd aliceTV Give with newOwner = bob submitUser adminId do exerciseCmd bobTV Give with newOwner = aliceThe docs say:
- “indicates which party to use by default when submitting a Ledger API command request as this user” 1.
- “Navigator… you will interact with the ledger as the primary party of that user.” 2.
Maybe I’m beginning to realize that
primaryPartyis metadata for tooling to use, not the Ledger API itself. Is that correct? Aside from Navigator, do you know of any other time thatprimaryPartyis used? - WallaceKelly
@cocreature responded to a similar question in the GSF Slack:
primaryPartydoesn’t imply anything. it doesn’t grant any rights but it is often used by tooling to interpret which party the user intends to use. E.g., the splice wallet UI always shows you the wallet for that party.