josephawallace / codis

Secure cryptocurrency custody using MPC
0 stars 0 forks source link

Codis host port 50099 is not accessible on Windows #1

Open michaelbarbas opened 1 year ago

michaelbarbas commented 1 year ago

Who: As a Milque developer, ensure program interoperability across environments.

What: When setting up host port on windows (wsl) with docker compose up host, it fails. By default the socket is forbidden.

Description: Alter the dockercompose.yaml file to run on a port accessible by default configuration on a windows machine. By default, there are ranges of ports labeled as "Administered port exclusions" -- Not sure if this is standard on all machines, but on mine it is default. More info can be found by running > netsh interface ipv4 show excludedportrange protocol=tcp via PowerShell.

Requirements:

Deliverable:

michaelbarbas commented 1 year ago

Result from > netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      1487        1487
     49698       49797
     49798       49897
     50000       50059     *
     50067       50166
     60387       60486
     60487       60586
     61293       61392
     61393       61492
     61675       61774
     61972       62071
     62072       62171

* - Administered port exclusions.
josephawallace commented 1 year ago

This writeup says Docker and Hyper-V are taking up a bunch of ports. It looks like the comment above confirms that.

One approach could be to use port 0 so any open port is selected. The issue here is that we wouldn't be able to select the correct port to expose in the docker compose file though, so the client wouldn't have a way to connect to the network. To solve this, we could publish all ports on the host node docker container by running docker run with the -P flag, then it doesn't matter which port the host ends up using. Note: I think we would also have to use a flag to specify the network that the container would attach to.

I believe this approach would work; I just would prefer that all the services are run with docker compose.

michaelbarbas commented 1 year ago

Can we just change the port to one outside of those ranges? Seems easy enough