Static Party Id

Hello Daml Community,

I have a question about party ids.

I have read this article, and i came to the conclusion that it is not possible to have static id parties.

I have a canton network, 2 remote participants and 1 remote domain. I create my party id with this command:

daml script --dar .daml/dist/Project-0.0.1.dar --ledger-host 192.168.61.128 --ledger-port 5011 --output-file party_bob.json --script-name Lights:initializeUser

and my script to allocate the Party:

data LedgerParties = LedgerParties with
   bob : Party
initializeUser : Script LedgerParties
initializeUser = do 
   partyBob <- allocatePartyWithHint "bob" (PartyIdHint "bob") 
   bob <- validateUserId "bob"  
   _ <- createUser (User bob (Some partyBob)) [CanActAs partyBob]
   pure (LedgerParties partyBob)

If the system goes down, when I reload it, i need to create new party ids with command above.

Is it possible to upload the old party id stored in the json file i created?

I ask this because I have persistence with postgres in the domain. When i reboot the system to test the persistence i came to the conclusion that the contracts of the partyA (participant1) created earlier, will no longer be seen by partyA2.0 (participant1 reboot), because they will have a different id.

Is there any solution to this? If so, can you point me to the documentation.

Thank you

HI @Bernardo ,

If you use persistence across all your nodes, your parties should be persisted between failures/restarts. You should not run in-memory participants other than for testing. Are you saying that your parties are lost even with persistence enabled?

1 Like

Hello Mate,

I will try to use persistence on all nodes and give feedback, i was only trying in domain node.

Thank you

It works, with persistence across all nodes,

Thank you.

1 Like