Skip to content
CCPEDIAby Unity Nodes
App Development

How to get the participant id when auth-services is configured?

4 posts215 views4 likesLast activity Oct 2025

  1. WallaceKellyOP 1

    Question: If I have an up-and-running participant node with auth-services configured, how do I get the participant id?


    Without auth-services configured, I can get the participant id like this:

    > grpcurl -plaintext localhost:5005 \
      com.daml.ledger.api.v1.admin.PartyManagementService/GetParticipantId \
      | jq -r '.participant_id'
    
    participant2::1220d182f96742328a7627d18b032af9cd17f1e0a09391fd9a4ecb5bcaa50821f987
    

    With auth-services configured, I need a token to call that endpoint:

    > grpcurl -plaintext localhost:5003 \
      com.daml.ledger.api.v1.admin.PartyManagementService/GetParticipantId \
      | jq -r '.participant_id'
    
    ERROR:
      Code: Unauthenticated
    

    But, to create the ~chicken~ token I need the ~egg~ participant id.

  2. WallaceKelly 1

    The following, added to the node’s bootstrap script, writes the participant id to a file:

    import java.nio.file.{Paths, Files}
    import java.nio.charset.StandardCharsets
    
    Files.write(
      Paths.get("/canton/host/configs/participant1.id"),
      participant1.id.toProtoPrimitive
        .substring(5)
        .getBytes(StandardCharsets.UTF_8)
    )
    

    Am I overlooking something simpler?

  3. WallaceKelly 1

    I find that the participant id can also be found in the logs.

    For example:

    INFO  c.d.c.p.s.b.c.ParameterStorageBackendImpl$:
    participant=participant1 -
    Initializing new database for ledgerId 'participant1' and participantId 
    'participant1::1220dd728fe4293ff821108301b205dddc95d80bc6965e58b7fdb2a71de8d2b2a9b9'
    
  4. WallaceKelly 1

    At some point, the participant id was moved to here:

    grpcurl -plaintext localhost:6866 \
        com.digitalasset.canton.admin.participant.v30.ParticipantStatusService.ParticipantStatus \
        | jq -r '.status.commonStatus.uid'
    

    (I am now using 3.4.0-snapshot.20251003.17075.0.v69d92264)