daml start --json-api-option "--address 0.0.0.0"
gives me
Waiting for JSON API to start:
Error: Unknown option --address 0.0.0.0
What am I doing wrong?
daml start --json-api-option "--address 0.0.0.0"
gives me
Waiting for JSON API to start:
Error: Unknown option --address 0.0.0.0
What am I doing wrong?
If you pass --json-api-option myoption
(and the same holds for --sandbox-option
and --navigator-option
), the JSON API will see exactly one argument with the value myoption
. There is no magic splitting on spaces performed here. So for your example the JSON API sees a single argument of value --address 0.0.0.0
. However, it expects this to be passed as two arguments instead: First --address
and then 0.0.0.0
. There are two ways to fix this:
=
sign to separate the option name and the value and pass them in a single argument. So for your example that would be --json-api-option "--address=0.0.0.0"
.--json-api-option
multiple times: So for your example that would be --json-api-option "--address" --json-api-option "0.0.0.0
.For this simple example I would probably go with 1 but in general if you actually have multiple completely separate options you have to use option 2 to separate them.
Is your option 2 something that should work or does it require code change on your end? I’ve tried this on SDK 1.14.0:
daml start --json-api-option --ledger-host --json-api-option myhost --json-api-option --ledger-port --json-api-option XXXX
But I get:
.Waiting for JSON API to start:
Error: Unknown option --ledger-host
Error: Unknown argument 'myhost'
Error: Unknown option --ledger-port
Error: Unknown argument 'XXXX'
Try --help for more information.
I think you can’t set the ledger host and port for the JSON API independently when using daml start
. daml start
automatically passes localhost
and the sandbox port to the JSON API via CLI flags so setting your own CLI flags causes a clash resulting in a somewhat misleading error message.
If you want to start the json-api
against a remote ledger, use daml json-api
. If you want to run the sandbox and JSON API with a non-standard Ledger API port using daml start
, use daml start --sandbox-port XXXX
.