Right now in the current implementation it is not supported to run multiple nodes on the developer testnet because of a technicality with
docker-compose and the way the environment is set up. The problem arises in that we are mapping a port from the
p2p container to the host here (note that this file belongs to another repo, but that is the one that is fetched by
discovery-cli when you run
init). This port is the one that is configured in the
enigma-js library as the “entrypoint” or “gateway” into the network. As we “scale” up the number of
p2p containers, there is a clash in multiple containers trying to map the same port. You can see for yourself if you try something like the following in your project folder:
docker-compose up --scale core=3 --scale p2p=3
enigma_core_1 is up-to-date
enigma_core_2 is up-to-date
enigma_core_3 is up-to-date
enigma_client_1 is up-to-date
enigma_contract_1 is up-to-date
enigma_km_1 is up-to-date
WARNING: The "p2p" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
Recreating enigma_p2p_1 ... done
Recreating 4564446edbb2_enigma_p2p_2 ... error
Recreating 460eddb0bfff_enigma_p2p_3 ... error
ERROR: for 460eddb0bfff_enigma_p2p_3 Cannot start service p2p: driver failed programming external connectivity on endpoint enigma_p2p_3 (6d2226599b0b3b7d25d5c821849b32141757166f1395dddf4269d26f2c9df280): all ports are allocated
ERROR: for 4564446edbb2_enigma_p2p_2 Cannot start service p2p: driver failed programming external connectivity on endpoint enigma_p2p_2 (909cffd49da8dbc0daf8651ada4e7dbe701a85c0f9ef328b32bbd81a9ced481d): all ports are allocated
ERROR: for p2p Cannot start service p2p: driver failed programming external connectivity on endpoint enigma_p2p_3 (6d2226599b0b3b7d25d5c821849b32141757166f1395dddf4269d26f2c9df280): all ports are allocated
ERROR: Encountered errors while bringing up the project.
While this is a relatively common setup in docker-compose with scale, the solution is a bit more involved requiring a reverse proxy or a load balancer, as suggested here, but this gets somewhat out of scope of what we envisioned this CLI for, that is to provide a simple, yet fully functional setup aimed primarily at writing, debugging and testing secret contracts, where we limited the network to one node for the sake of simplicity. Given enough interest, we can implement this, but right now it’s not our immediate priority.
I have opened an issue here to track it, and I would propose that if we get say 15 there (on the Github issue, not on this forum thread) as a sign of community interest, I will make an effort to implement it.