Skip to content

Commit

Permalink
refactor: reassign ports 3600 and 3610 (#740)
Browse files Browse the repository at this point in the history
Change `p2p-tcp-address` to 3610 and `validator-api-address` to 3600.

category: refactor
ticket: #732
  • Loading branch information
xenowits committed Jun 22, 2022
1 parent 2998090 commit 24ab3dd
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 53 deletions.
6 changes: 3 additions & 3 deletions cmd/cmd_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestCmdFlags(t *testing.T) {
P2P: p2p.Config{
UDPBootnodes: []string{"http://bootnode.gcp.obol.tech:16000/enr"},
UDPAddr: "127.0.0.1:3630",
TCPAddrs: []string{"127.0.0.1:3600"},
TCPAddrs: []string{"127.0.0.1:3610"},
Allowlist: "",
Denylist: "",
},
Expand All @@ -82,7 +82,7 @@ func TestCmdFlags(t *testing.T) {
LockFile: ".charon/cluster-lock.json",
DataDir: "from_env",
MonitoringAddr: "127.0.0.1:3620",
ValidatorAPIAddr: "127.0.0.1:3610",
ValidatorAPIAddr: "127.0.0.1:3600",
BeaconNodeAddr: "http://localhost/",
JaegerAddr: "",
JaegerService: "charon",
Expand All @@ -95,7 +95,7 @@ func TestCmdFlags(t *testing.T) {
P2PConfig: &p2p.Config{
UDPBootnodes: []string{"http://bootnode.gcp.obol.tech:16000/enr"},
UDPAddr: "127.0.0.1:3630",
TCPAddrs: []string{"127.0.0.1:3600"},
TCPAddrs: []string{"127.0.0.1:3610"},
Allowlist: "",
Denylist: "",
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func newRunCmd(runFunc func(context.Context, app.Config) error) *cobra.Command {
func bindRunFlags(flags *pflag.FlagSet, config *app.Config) {
flags.StringVar(&config.LockFile, "lock-file", ".charon/cluster-lock.json", "The path to the cluster lock file defining distributed validator cluster")
flags.StringVar(&config.BeaconNodeAddr, "beacon-node-endpoint", "http://localhost/", "Beacon node endpoint URL")
flags.StringVar(&config.ValidatorAPIAddr, "validator-api-address", "127.0.0.1:3610", "Listening address (ip and port) for validator-facing traffic proxying the beacon-node API")
flags.StringVar(&config.ValidatorAPIAddr, "validator-api-address", "127.0.0.1:3600", "Listening address (ip and port) for validator-facing traffic proxying the beacon-node API")
flags.StringVar(&config.MonitoringAddr, "monitoring-address", "127.0.0.1:3620", "Listening address (ip and port) for the monitoring API (prometheus, pprof)")
flags.StringVar(&config.JaegerAddr, "jaeger-address", "", "Listening address for jaeger tracing")
flags.StringVar(&config.JaegerService, "jaeger-service", "charon", "Service name used for jaeger tracing")
Expand All @@ -80,7 +80,7 @@ func bindP2PFlags(flags *pflag.FlagSet, config *p2p.Config) {
flags.StringVar(&config.UDPAddr, "p2p-udp-address", "127.0.0.1:3630", "Listening UDP address (ip and port) for discv5 discovery.")
flags.StringVar(&config.ExternalIP, "p2p-external-ip", "", "The IP address advertised by libp2p. This may be used to advertise an external IP.")
flags.StringVar(&config.ExternalHost, "p2p-external-hostname", "", "The DNS hostname advertised by libp2p. This may be used to advertise an external DNS.")
flags.StringSliceVar(&config.TCPAddrs, "p2p-tcp-address", []string{"127.0.0.1:3600"}, "Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic.")
flags.StringSliceVar(&config.TCPAddrs, "p2p-tcp-address", []string{"127.0.0.1:3610"}, "Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic.")
flags.StringVar(&config.Allowlist, "p2p-allowlist", "", "Comma-separated list of CIDR subnets for allowing only certain peer connections. Example: 192.168.0.0/16 would permit connections to peers on your local network only. The default is to accept all connections.")
flags.StringVar(&config.Denylist, "p2p-denylist", "", "Comma-separated list of CIDR subnets for disallowing certain peer connections. Example: 192.168.0.0/16 would disallow connections to peers on your local network. The default is to accept all connections.")
}
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ Flags:
--p2p-denylist string Comma-separated list of CIDR subnets for disallowing certain peer connections. Example: 192.168.0.0/16 would disallow connections to peers on your local network. The default is to accept all connections.
--p2p-external-hostname string The DNS hostname advertised by libp2p. This may be used to advertise an external DNS.
--p2p-external-ip string The IP address advertised by libp2p. This may be used to advertise an external IP.
--p2p-tcp-address strings Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic. (default [127.0.0.1:3600])
--p2p-tcp-address strings Comma-separated list of listening TCP addresses (ip and port) for libP2P traffic. (default [127.0.0.1:3610])
--p2p-udp-address string Listening UDP address (ip and port) for discv5 discovery. (default "127.0.0.1:3630")
--simnet-beacon-mock Enables an internal mock beacon node for running a simnet.
--simnet-validator-mock Enables an internal mock validator client when running a simnet. Requires simnet-beacon-mock.
--validator-api-address string Listening address (ip and port) for validator-facing traffic proxying the beacon-node API (default "127.0.0.1:3610")
--validator-api-address string Listening address (ip and port) for validator-facing traffic proxying the beacon-node API (default "127.0.0.1:3600")
````
<!-- Code above generated by cmd/cmd_internal_test.go#TestConfigReference. DO NOT EDIT -->
2 changes: 1 addition & 1 deletion testutil/compose/docker-compose.template
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
CHARON_DATA_DIR: /compose/bootnode
CHARON_P2P_BOOTNODES: ""
CHARON_P2P_EXTERNAL_HOSTNAME: bootnode
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3600
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3610
CHARON_P2P_UDP_ADDRESS: 0.0.0.0:3630
{{end -}}
{{- range $i, $vc := .VCs}}
Expand Down
4 changes: 2 additions & 2 deletions testutil/compose/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ func newNodeEnvs(index int, validatorMock bool, conf Config) []kv {
{"definition-file", "/compose/cluster-definition.json"},
{"lock-file", lockFile},
{"monitoring-address", "0.0.0.0:3620"},
{"validator-api-address", "0.0.0.0:3610"},
{"validator-api-address", "0.0.0.0:3600"},
{"p2p-external-hostname", fmt.Sprintf("node%d", index)},
{"p2p-tcp-address", "0.0.0.0:3600"},
{"p2p-tcp-address", "0.0.0.0:3610"},
{"p2p_udp_address", "0.0.0.0:3630"},
{"p2p-bootnodes", "http://bootnode:3640/enr"},
{"beacon-node-endpoint", beaconNode},
Expand Down
2 changes: 1 addition & 1 deletion testutil/compose/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func getVC(typ VCType, nodeIdx int, numVals int) (vc, error) {
Command: `|
validator-client
--network=auto
--beacon-node-api-endpoint="http://node{{.NodeIdx}}:3610"
--beacon-node-api-endpoint="http://node{{.NodeIdx}}:3600"
{{range .TekuKeys}}--validator-keys="{{.}}"
{{end -}}
--validators-proposer-default-fee-recipient="0x0000000000000000000000000000000000000000"`,
Expand Down
8 changes: 4 additions & 4 deletions testutil/compose/static/lighthouse/run.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash

while ! curl "http://${NODE}:3610/up" 2>/dev/null; do
echo "Waiting for http://${NODE}:3610/up to become available..."
while ! curl "http://${NODE}:3600/up" 2>/dev/null; do
echo "Waiting for http://${NODE}:3600/up to become available..."
sleep 5
done

echo "Creating testnet config"
rm -rf /tmp/testnet || true
mkdir /tmp/testnet/
curl "http://${NODE}:3610/eth/v1/config/spec" | jq -r .data | yq -P > /tmp/testnet/config.yaml
curl "http://${NODE}:3600/eth/v1/config/spec" | jq -r .data | yq -P > /tmp/testnet/config.yaml
echo "0" > /tmp/testnet/deploy_block.txt

for f in /compose/"${NODE}"/validator_keys/keystore-*.json; do
Expand All @@ -23,5 +23,5 @@ done
echo "Starting lighthouse validator client for ${NODE}"
exec lighthouse validator \
--testnet-dir "/tmp/testnet" \
--beacon-node "http://${NODE}:3610" \
--beacon-node "http://${NODE}:3600" \
--suggested-fee-recipient "0x0000000000000000000000000000000000000000"
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node0"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down Expand Up @@ -105,15 +105,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node1"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down Expand Up @@ -176,15 +176,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node2"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down Expand Up @@ -247,15 +247,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node3"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down
18 changes: 9 additions & 9 deletions testutil/compose/testdata/TestDockerCompose_lock_dkg_yml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ services:
CHARON_DEFINITION_FILE: /compose/cluster-definition.json
CHARON_LOCK_FILE: /compose/node0/cluster-lock.json
CHARON_MONITORING_ADDRESS: 0.0.0.0:3620
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3610
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3600
CHARON_P2P_EXTERNAL_HOSTNAME: node0
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3600
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3610
CHARON_P2P_UDP_ADDRESS: 0.0.0.0:3630
CHARON_P2P_BOOTNODES: http://bootnode:3640/enr
CHARON_BEACON_NODE_ENDPOINT:
Expand All @@ -40,9 +40,9 @@ services:
CHARON_DEFINITION_FILE: /compose/cluster-definition.json
CHARON_LOCK_FILE: /compose/node1/cluster-lock.json
CHARON_MONITORING_ADDRESS: 0.0.0.0:3620
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3610
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3600
CHARON_P2P_EXTERNAL_HOSTNAME: node1
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3600
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3610
CHARON_P2P_UDP_ADDRESS: 0.0.0.0:3630
CHARON_P2P_BOOTNODES: http://bootnode:3640/enr
CHARON_BEACON_NODE_ENDPOINT:
Expand All @@ -61,9 +61,9 @@ services:
CHARON_DEFINITION_FILE: /compose/cluster-definition.json
CHARON_LOCK_FILE: /compose/node2/cluster-lock.json
CHARON_MONITORING_ADDRESS: 0.0.0.0:3620
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3610
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3600
CHARON_P2P_EXTERNAL_HOSTNAME: node2
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3600
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3610
CHARON_P2P_UDP_ADDRESS: 0.0.0.0:3630
CHARON_P2P_BOOTNODES: http://bootnode:3640/enr
CHARON_BEACON_NODE_ENDPOINT:
Expand All @@ -82,9 +82,9 @@ services:
CHARON_DEFINITION_FILE: /compose/cluster-definition.json
CHARON_LOCK_FILE: /compose/node3/cluster-lock.json
CHARON_MONITORING_ADDRESS: 0.0.0.0:3620
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3610
CHARON_VALIDATOR_API_ADDRESS: 0.0.0.0:3600
CHARON_P2P_EXTERNAL_HOSTNAME: node3
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3600
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3610
CHARON_P2P_UDP_ADDRESS: 0.0.0.0:3630
CHARON_P2P_BOOTNODES: http://bootnode:3640/enr
CHARON_BEACON_NODE_ENDPOINT:
Expand All @@ -102,7 +102,7 @@ services:
CHARON_DATA_DIR: /compose/bootnode
CHARON_P2P_BOOTNODES: ""
CHARON_P2P_EXTERNAL_HOSTNAME: bootnode
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3600
CHARON_P2P_TCP_ADDRESS: 0.0.0.0:3610
CHARON_P2P_UDP_ADDRESS: 0.0.0.0:3630

networks:
Expand Down
20 changes: 10 additions & 10 deletions testutil/compose/testdata/TestDockerCompose_run_template.golden
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node0"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down Expand Up @@ -105,15 +105,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node1"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down Expand Up @@ -176,15 +176,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node2"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down Expand Up @@ -247,15 +247,15 @@
},
{
"Key": "validator-api-address",
"Value": "0.0.0.0:3610"
"Value": "0.0.0.0:3600"
},
{
"Key": "p2p-external-hostname",
"Value": "node3"
},
{
"Key": "p2p-tcp-address",
"Value": "0.0.0.0:3600"
"Value": "0.0.0.0:3610"
},
{
"Key": "p2p_udp_address",
Expand Down Expand Up @@ -294,7 +294,7 @@
"Label": "teku",
"Image": "consensys/teku:latest",
"Build": "",
"Command": "|\n validator-client\n --network=auto\n --beacon-node-api-endpoint=\"http://node0:3610\"\n --validator-keys=\"/compose/node0/validator_keys/keystore-0.json:/compose/node0/validator_keys/keystore-0.txt\"\n --validator-keys=\"/compose/node0/validator_keys/keystore-1.json:/compose/node0/validator_keys/keystore-1.txt\"\n --validators-proposer-default-fee-recipient=\"0x0000000000000000000000000000000000000000\"",
"Command": "|\n validator-client\n --network=auto\n --beacon-node-api-endpoint=\"http://node0:3600\"\n --validator-keys=\"/compose/node0/validator_keys/keystore-0.json:/compose/node0/validator_keys/keystore-0.txt\"\n --validator-keys=\"/compose/node0/validator_keys/keystore-1.json:/compose/node0/validator_keys/keystore-1.txt\"\n --validators-proposer-default-fee-recipient=\"0x0000000000000000000000000000000000000000\"",
"Ports": null
},
{
Expand All @@ -315,7 +315,7 @@
"Label": "teku",
"Image": "consensys/teku:latest",
"Build": "",
"Command": "|\n validator-client\n --network=auto\n --beacon-node-api-endpoint=\"http://node3:3610\"\n --validator-keys=\"/compose/node3/validator_keys/keystore-0.json:/compose/node3/validator_keys/keystore-0.txt\"\n --validator-keys=\"/compose/node3/validator_keys/keystore-1.json:/compose/node3/validator_keys/keystore-1.txt\"\n --validators-proposer-default-fee-recipient=\"0x0000000000000000000000000000000000000000\"",
"Command": "|\n validator-client\n --network=auto\n --beacon-node-api-endpoint=\"http://node3:3600\"\n --validator-keys=\"/compose/node3/validator_keys/keystore-0.json:/compose/node3/validator_keys/keystore-0.txt\"\n --validator-keys=\"/compose/node3/validator_keys/keystore-1.json:/compose/node3/validator_keys/keystore-1.txt\"\n --validators-proposer-default-fee-recipient=\"0x0000000000000000000000000000000000000000\"",
"Ports": null
}
],
Expand Down
Loading

0 comments on commit 24ab3dd

Please sign in to comment.