Skip to content
CCPEDIAby Unity Nodes
App Development

When running the sandbox in a container I can not access its ledger-api from the host machine

4 posts330 views4 likesLast activity Aug 2022

  1. DarkoOP 1

    I am aware that I need to set the ledger-api address to 0.0.0.0 for the API to be accessible from the host machine as specified here Installing Canton — Daml SDK 2.3.2 documentation

    However, I was not able to do so so far.

    I tried running:

    - daml sandbox --dar [path/to.dar] -C address=0.0.0.0
    

    and

    - daml sandbox --dar [path/to.dar] -C ledger-api.address=0.0.0.0
    

    but it didn’t work. I am assuming that I need to do something like this?

     daml sandbox --dar [path/to.dar] -C [participantName].ledger-api.address=0.0.0.0
    

    If the documentation for this doesn’t exist, I think it would be useful to create it as I believe this could be a fairly common use case.

  2. cocreature 2

    The crucial sentence here is in the sandbox docs:

    Behind the scenes, Sandbox spins up a Canton ledger with an in-memory participant sandbox and an in-memory domain local.

    So your example should be

    -C canton.participants.sandbox.ledger-api.address=0.0.0.0
    
  3. Darko

    thanks!

    I actually tried using sandbox.ledger-api.address
    but I missed the full path of canton.participants.[...] :man_facepalming:

    However, I think that this use case could be common enough for an explicit explanation in the docs.

  4. Ianw1 1

    FWIW for future readers looking to get this working, I describe the steps I took in this blog, albeit I created a new Docker image with the required setting.