hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.52k stars 844 forks source link

Separate Listening and Discovery Ports in Node Configuration #2308

Open ItayPodhajcer opened 3 years ago

ItayPodhajcer commented 3 years ago

Description

According to the documentation on P2P Port configuration, the --p2p-port options/BESU_P2P_PORT environment variable/p2p-port configuration file option can be used to configure the listening port for the node, which is used for both the TCP listening port and the UDP discovery port.

Strangely enough, there are sections in the documentation that describe a valid Enode URL that allows setting a different discovery port using a discport query parameter.

This brings the question of if those Enode URLs are supported, how can one configure a dedicated port for discovery, which has a different number than the listening port.

Acceptance Criteria

Allow configuring the listening port and discovery port of the node separatly,

Additional Information

It might seem like a small issue, but in scenarios that require exposing both ports, it creates limitations such as the cloud services that can be used to run nodes (at the time of opening this issue, both Azure ACI and AWS ECS do not support opening the same port number for both TCP and UDP at the same time).

NicolasMassart commented 3 years ago

Hi @ItayPodhajcer, Having two different ports for listening and advertising is not available in the base CLI use case, but if you use Besu with Kubernetes for instance, you can do it by setting services multiple port mappings and using the Besu Kubernetes NAT option.

Could you tell me if your use case includes using Kubernetes?

ItayPodhajcer commented 3 years ago

@NicolasMassart Kubernetes is such an overkill in so many cases, especially when ACI/ECS are enough to get the job done. Any plans to update the CLI in the near future?

TrishamBP commented 2 years ago

@NicolasMassart How can we tackle this issue and make changes in our code? I have also been facing a lot of trouble getting my ports configured.