Skip to content
CCPEDIAby Unity Nodes
App Development

Daml 2.0 - How to change the sandbox ledger id?

5 posts307 views1 likesLast activity Mar 2022

  1. jaypeedaOP

    Hi team,

    How do you change the ledger id in Daml 2.0 ?

    Cheers,

    Jean-Paul

  2. Ratko_Veprek

    The ledger-id of a participant node is hard coded to participant.uid.id:

    github.com

    digital-asset/canton/blob/09cd027ebcd861ddb537e6cd6d102178b5b765df/community/participant/src/main/scala/com/digitalasset/canton/participant/ParticipantNode.scala#L488

          
            
    1. syncDomainPersistentStateFactory.initializePersistentStates(domainAliasManager)
    2. )
    3. multiDomainCausalityStore <- EitherT.liftF(
    4. MultiDomainCausalityStore(storage, indexedStringStore, timeouts, loggerFactory)
    5. )
    6. ledgerId = participantId.uid.id.unwrap
    7. resourceManagementService = resourceManagementServiceFactory(persistentState.settingsStore)
    8. // Sync Service
    9. sync = cantonSyncServiceFactory.create(
    10. participantId,
    11. domainRegistry,
    12. domainConnectionConfigStore,
    13. domainAliasManager,
    14. persistentState,
    15. ephemeralState,
    16. syncDomainPersistentStateManager,
    17. syncDomainPersistentStateFactory,

    So by default, this is set to the “config name” of the participant.

  3. jaypeeda

    So you cannot change that in daml.yaml or is there a way to change the participant.uid.id ?

  4. Ratko_Veprek 1

    You can not change it after a Canton participant node has been initialised. However, when you write a new Canton configuration file, you can name the participant accordingly such that it matches your expected ledger id.

  5. jaypeeda

    Understood, thanks !