-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p2p: support configuring NAT in TOML file #31041
base: master
Are you sure you want to change the base?
Conversation
// protocol. | ||
BootstrapNodesV5 []*enode.Node `toml:",omitempty"` | ||
|
||
// Static nodes are used as pre-configured connections which are always |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Static nodes are used as pre-configured connections which are always | |
// StaticNodes are used as pre-configured connections which are always |
// allowed to connect, even above the peer limit. | ||
TrustedNodes []*enode.Node | ||
|
||
// Connectivity can be restricted to certain IP networks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Connectivity can be restricted to certain IP networks. | |
// NetRestrict is used to restrict connectivity to specific IP networks. |
// If ListenAddr is set to a non-nil address, the server | ||
// will listen for incoming connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If ListenAddr is set to a non-nil address, the server | |
// will listen for incoming connections. | |
// ListenAddr specifies the address on which the server will listen for incoming connections. | |
// If set to a non-empty value, the server will actively listen for connections on this address. |
// If DiscAddr is set to a non-nil value, the server will use ListenAddr | ||
// for TCP and DiscAddr for the UDP discovery protocol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If DiscAddr is set to a non-nil value, the server will use ListenAddr | |
// for TCP and DiscAddr for the UDP discovery protocol. | |
// DiscAddr specifies the address to be used for the UDP discovery protocol. | |
// If set to a non-empty value, the server will use ListenAddr for TCP connections | |
// and DiscAddr for UDP-based discovery communication. |
// If set to a non-nil value, the given NAT port mapper | ||
// is used to make the listening port available to the | ||
// Internet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If set to a non-nil value, the given NAT port mapper | |
// is used to make the listening port available to the | |
// Internet. | |
// NAT specifies the NAT port mapping mechanism to use for making the listening port | |
// accessible from the Internet. If set to a non-nil value, the provided NAT interface | |
// will be used to map and expose the server's listening port. |
// If Dialer is set to a non-nil value, the given Dialer | ||
// is used to dial outbound peer connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If Dialer is set to a non-nil value, the given Dialer | |
// is used to dial outbound peer connections. | |
// Dialer specifies the dialer used to establish outbound peer connections. | |
// If set to a non-nil value, the provided dialer will be used to dial and connect | |
// to remote peers. If nil, a default dialing mechanism will be used. |
// is used to dial outbound peer connections. | ||
Dialer NodeDialer `toml:"-"` | ||
|
||
// If NoDial is true, the server will not dial any peers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If NoDial is true, the server will not dial any peers. | |
// NoDial controls whether the server will initiate outbound connections to peers. | |
// If set to true, the server will not dial any peers and will only accept incoming connections. |
// If EnableMsgEvents is set then the server will emit PeerEvents | ||
// whenever a message is sent to or received from a peer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// If EnableMsgEvents is set then the server will emit PeerEvents | |
// whenever a message is sent to or received from a peer | |
// EnableMsgEvents enables the emission of PeerEvents for message activity. | |
// If set to true, the server will emit events whenever a message is sent to or received from a peer. |
|
||
// Config holds Server options. | ||
type Config struct { | ||
// This field must be set to a valid secp256k1 private key. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This field must be set to a valid secp256k1 private key. | |
// PrivateKey specifies the secp256k1 private key used for cryptographic operations. | |
// This field must be set to a valid ECDSA private key; otherwise, the server will not function properly. |
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. | |
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. | |
This is an alternative for #27407 with a solution based on gencodec. With the PR, one can now configure like this: