IllegalArgumentException: Invalid host or port in Canton remote static configuration?

Question

Would you expect that network names could be used for addresses within Canton remote configuration files? Or do those have to be IP addresses?

Example

My remote configuration fails if I use the network name for the address field:

canton.remote-domains.gameshow {
  admin-api {
      address="node_domain"
      port="5019"
  }
  public-api {
      address = "node_domain"
      port = "5018"
      transport-security = false
  }
}

By fails I mean that within the Canton Console I cannot check the health of the node from my remote machine.

@ domain_gameshow.health.status

java.lang.IllegalArgumentException:
Invalid host or port: node_domain 5019

If I exit the Canton Console, ping -c 3 node_domain, copy-and-paste the IP address into my static remote configuration, then…

My remote configuration succeeds if I use the IP address for the address:

canton.remote-domains.domain_gameshow {
    admin-api {
        # address = "node_domain"
        address = "192.168.32.4"
        port = "5019"
    }
    public-api {
        # address = "node_domain"
        address = "192.168.32.4"
        port = "5018"
        transport-security = false
    }
}

By succeeds I mean that I can check the health of the remote domain node.

@ domain_gameshow.health.status

res1: com.digitalasset.canton.health.admin.data.NodeStatus
[com.digitalasset.canton.health.admin.data.DomainStatus] =
Domain id: domain_gameshow::122071...8ce5e9
Uptime: 20m 42.475901s
Ports:
	admin: 5019
	public: 5018
Connected Participants: None
Sequencer: SequencerHealthStatus(isActive = true)
2 Likes

Hi @WallaceKelly

I have used domain names instead of an IP address in remote configuration countless times before. The error message is generated by the gRPC library failing on the invalid host name, that node_domain is. While certain tools allow you to create emulated host names with _ inside, by standard it is not allowed in the host name, only in some other parts of an URL. For your reference from RFC 1738:

host
The fully qualified domain name of a network host, or its IP address as a set of four decimal digit groups separated by “.”. Fully qualified domain names take the form as described in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC 1123 [5]: a sequence of domain labels separated by “.”, each domain label starting and ending with an alphanumerical character and possibly also containing “-” characters. The rightmost domain label will never start with a digit, though, which syntactically distinguishes all domain names from the IP addresses.

Kind Regards,
Mate

2 Likes

Thank you, @Mate_Varga! You are correct (of course!) I replaced the underscore character with a hyphen character in the machine network names and that corrected the issue. I would not have thought of that.


By the way, I am using docker compose to setup “the network” on my workstation just to learn Canton. I’m adding the words “docker compose” to help with future search results. :slight_smile: