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

I am aware that I need to set the ledger-api address to 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=


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

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=

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.

1 Like

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=


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.

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.

1 Like