Canton: how to set participant's ledger id
- Daniel_PorterOP
I’m working on an application that creates a large number of ledgers with arbitrary ledgerids, and want to use canton.
Looking in the docs, I inferred that I could
-
explicitly set it via the
ApiServiceWrapper, or - implicitly set it via the static config, a la
canton { participants { participant1 { } } }which, as far as I can tell, sets the ledger id to
participant1. Would love to be able to set the ledgerid without having to roll my own image/construct conf files on the fly. Is this possible? -
explicitly set it via the
- Rafael_Guglielmetti
Hi @Daniel_Porter ,
The ledgerId is read from config and used as part of the initialization of the participant node when it starts (the two ways you mention are in fact the same one: the config populates the value inCantonLedgerApiServerWrapper.Config.ledgerId). Currently, there is no way to change the value once the participant is running.Maybe what you could do is to pass the config value via the command line?
Cheers,
Raf
- Ratko_Veprek 1
The ledgerId in Canton is currently hard-coded to the
participant.uid.id. You can configure your own.idby manually initializing your node: Canton Console — Canton 1.0.0-SNAPSHOT [0J documentationFor this, you have to turn of auto-initialization by setting
canton.participants.<p>.init.auto-init = falseBut then you need to manually allocate keys, issue the certificates etc. I actually wrote it up here: Canton offline key for static participant ID - #2 by Ratko_Veprek