Daml start then using daml canton-console to access

Hi team,

I am running daml sdk 2.1.1, and do a quick test with the following project

daml new testing
cd testing
daml start

After everything was up and running (navigator, jsonapi, etc) I accessed the canton console with daml canton-console. When I did a health status i got the following error

@ health.status
res0: consoleEnvironment.Status = Domain 'local' cannot be reached: Request failed for local. Is the server running? Are you using the right TLS settings?
  GrpcServiceUnavailable: UNAVAILABLE/io exception
  Request: com.digitalasset.canton.admin.api.client.commands.StatusAdminCommands$GetStatus@5eef8a16
  Causes: Connection refused: /127.0.0.1:6868
    Connection refused

Participant 'sandbox' cannot be reached: Request failed for sandbox. Is the server running? Are you using the right TLS settings?
  GrpcServiceUnavailable: UNAVAILABLE/io exception
  Request: com.digitalasset.canton.admin.api.client.commands.StatusAdminCommands$GetStatus@2114eb1a
  Causes: Connection refused: /127.0.0.1:6866
    Connection refused

However, if I started with the following commands,

daml sandbox --dar .daml/dist/test-0.0.1.dar
daml script ...
daml navigator ...
daml json-api ...

Then I can get the health status in the console, i.e.

@ health.status
res0: consoleEnvironment.Status = Status for Domain 'local':
Domain id: local::12201423380dd29f0ba3183b62f0f40a5fc058047063ed151ba3d3c51954863c0710
Uptime: 1m 42.645303s
Ports:
	admin: 6868
	public: 6867
Connected Participants:
	PAR::sandbox::1220b45ffafa...
Sequencer: SequencerHealthStatus(isActive = true)

Status for Participant 'sandbox':
Participant id: PAR::sandbox::1220b45ffafa5a5d6a6e3ff9b8c1cba1bd82757da9fe0a4f02be917865d67ad0f853
Uptime: 1m 39.413108s
Ports:
	ledger: 6865
	admin: 6866
Connected domains:
	local::12201423380d...
Unhealthy domains: None
Active: true

What is the difference between running daml start and running commands separately?

Thanks in advance.

kc

1 Like

Hi @kctam,

The generated config file is slightly different: whereas the daml sandbox command results in these options:

{
  "canton": {
    "domains": {
      "local": {
        "admin-api": {
          "port": 6868
        },
        "public-api": {
          "port": 6867
        },
        "storage": {
          "type": "memory"
        }
      }
    },
    "parameters": {
      "ports-file": "/var/folders/fr/hnsktbhj611cbgfj6thp_jcr0000gn/T/extra-dir-67051942666/canton-portfile.json"
    },
    "participants": {
      "sandbox": {
        "admin-api": {
          "port": 6866
        },
        "ledger-api": {
          "port": 6865,
          "user-management-service": {
            "enabled": true
          }
        },
        "storage": {
          "type": "memory"
        }
      }
    }
  }
}

the daml start command uses different ports:

{
  "canton": {
    "domains": {
      "local": {
        "admin-api": {
          "port": 50819
        },
        "public-api": {
          "port": 50818
        },
        "storage": {
          "type": "memory"
        }
      }
    },
    "parameters": {
      "ports-file": "/var/folders/fr/hnsktbhj611cbgfj6thp_jcr0000gn/T/extra-dir-87149629666/sandbox-portfile"
    },
    "participants": {
      "sandbox": {
        "admin-api": {
          "port": 50817
        },
        "ledger-api": {
          "port": 6865,
          "user-management-service": {
            "enabled": true
          }
        },
        "storage": {
          "type": "memory"
        }
      }
    }
  }
}

Those ports are automatically-generated as can be seen here.

I’m not familiar enough with this part of the code to know why these sets of options differ. I’ve opened a pull request.

Thanks @Gary_Verhaegen . I have passed the ports in daml start and it works fine now with daml canton-console

daml start --sandbox-admin-api-port 6866 --sand
box-domain-public-port 6867 --sandbox-domain-admin-port 6868

And yes, it is better if I don’t need to do so, and the experience on both daml start and daml sandbox should be the same when using daml canton-console.

Thanks again for following up on this.

cheers,
kc

Following up: the pull request has been merged, so this fix will likely make it in 2.3.

Thanks for reporting!

1 Like