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 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.

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=0.0.0.0
2 Likes

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.

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