Compare commits

...
Author SHA1 Message Date
dboreham 0b512db693 Handle udp ports mapped (#534)
* Handle udp ports mapped

* Fix lint error
2023-09-19 13:27:34 -06:00
dboreham e0ecbc3ab3 Remove private repo from stack (#532) 2023-09-19 10:36:05 -06:00
2 changed files with 5 additions and 6 deletions
+1 -4
View File
@@ -1,4 +1,4 @@
version: "1.1" version: "1.2"
name: mainnet-eth name: mainnet-eth
description: "Ethereum Mainnet" description: "Ethereum Mainnet"
repos: repos:
@@ -7,7 +7,6 @@ repos:
- github.com/dboreham/foundry - github.com/dboreham/foundry
- git.vdb.to/cerc-io/keycloak-reg-api - git.vdb.to/cerc-io/keycloak-reg-api
- git.vdb.to/cerc-io/keycloak-reg-ui - git.vdb.to/cerc-io/keycloak-reg-ui
- github.com/vulcanize/eth-api-proxy
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum
- cerc/lighthouse - cerc/lighthouse
@@ -17,10 +16,8 @@ containers:
- cerc/webapp-base - cerc/webapp-base
- cerc/keycloak-reg-api - cerc/keycloak-reg-api
- cerc/keycloak-reg-ui - cerc/keycloak-reg-ui
- cerc/eth-api-proxy
pods: pods:
- mainnet-eth - mainnet-eth
- mainnet-eth-keycloak - mainnet-eth-keycloak
- mainnet-eth-metrics - mainnet-eth-metrics
- mainnet-eth-api-proxy
- foundry - foundry
+4 -2
View File
@@ -178,16 +178,18 @@ def _get_mapped_ports(stack: str, map_recipe: str):
ports_array = ports[service] ports_array = ports[service]
for x in range(0, len(ports_array)): for x in range(0, len(ports_array)):
orig_port = ports_array[x] orig_port = ports_array[x]
# Strip /udp suffix if present
bare_orig_port = orig_port.replace("/udp", "")
random_port = random.randint(20000, 50000) # Beware: we're relying on luck to not collide random_port = random.randint(20000, 50000) # Beware: we're relying on luck to not collide
if map_recipe == "any-variable-random": if map_recipe == "any-variable-random":
# This is the default so take no action # This is the default so take no action
pass pass
elif map_recipe == "localhost-same": elif map_recipe == "localhost-same":
# Replace instances of "- XX" with "- 127.0.0.1:XX" # Replace instances of "- XX" with "- 127.0.0.1:XX"
ports_array[x] = f"127.0.0.1:{orig_port}:{orig_port}" ports_array[x] = f"127.0.0.1:{bare_orig_port}:{orig_port}"
elif map_recipe == "any-same": elif map_recipe == "any-same":
# Replace instances of "- XX" with "- 0.0.0.0:XX" # Replace instances of "- XX" with "- 0.0.0.0:XX"
ports_array[x] = f"0.0.0.0:{orig_port}:{orig_port}" ports_array[x] = f"0.0.0.0:{bare_orig_port}:{orig_port}"
elif map_recipe == "localhost-fixed-random": elif map_recipe == "localhost-fixed-random":
# Replace instances of "- XX" with "- 127.0.0.1:<rnd>:XX" # Replace instances of "- XX" with "- 127.0.0.1:<rnd>:XX"
ports_array[x] = f"127.0.0.1:{random_port}:{orig_port}" ports_array[x] = f"127.0.0.1:{random_port}:{orig_port}"