Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions anchor/client/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ pub struct Node {
#[clap(
long,
value_name = "NETWORK_ADDRESSES",
value_delimiter = ',',
help = "Comma-separated addresses to one or more beacon node HTTP APIs. \
Default is http://localhost:5052.",
display_order = 0
Expand All @@ -109,6 +110,7 @@ pub struct Node {
#[clap(
long,
value_name = "NETWORK_ADDRESSES",
value_delimiter = ',',
help = "Comma-separated addresses to one or more execution node JSON-RPC APIs. \
Default is http://localhost:8545.",
display_order = 0
Expand All @@ -118,6 +120,7 @@ pub struct Node {
#[clap(
long,
value_name = "NETWORK_ADDRESSES",
value_delimiter = ',',
help = "Address of execution node WS API. \
Default is ws://localhost:8546.",
display_order = 0
Expand All @@ -127,6 +130,7 @@ pub struct Node {
#[clap(
long,
value_name = "CERTIFICATE-FILES",
value_delimiter = ',',
help = "Comma-separated paths to custom TLS certificates to use when connecting \
to a beacon node (and/or proposer node). These certificates must be in PEM format and are used \
in addition to the OS trust store. Commas must only be used as a \
Expand All @@ -138,6 +142,7 @@ pub struct Node {
#[clap(
long,
value_name = "CERTIFICATE-FILES",
value_delimiter = ',',
help = "Comma-separated paths to custom TLS certificates to use when connecting \
to an exection node. These certificates must be in PEM format and are used \
in addition to the OS trust store. Commas must only be used as a \
Expand Down Expand Up @@ -211,6 +216,7 @@ pub struct Node {
#[clap(
long,
value_name = "ADDRESS",
value_delimiter = ',',
help = "The address anchor will listen for UDP and TCP connections. To listen \
over IpV4 and IpV6 set this flag twice with the different values.\n\
Examples:\n\
Expand All @@ -232,7 +238,7 @@ pub struct Node {
The discovery UDP port will be set to this value and the Quic UDP port will be set to this value + 1. The discovery port can be modified by the \
--discovery-port flag and the quic port can be modified by the --quic-port flag. If listening over both IPv4 and IPv6 the --port flag \
will apply to the IPv4 address and --port6 to the IPv6 address.",
default_value = "9100",
default_value = "13001",
action = ArgAction::Set,
)]
pub port: u16,
Expand All @@ -249,7 +255,8 @@ pub struct Node {
#[clap(
long,
value_name = "PORT",
help = "The UDP port that discovery will listen on. Defaults to `port`",
help = "The UDP port that discovery will listen on. Defaults to `12001`",
default_value = "12001",
action = ArgAction::Set,
)]
pub discovery_port: Option<u16>,
Expand All @@ -258,7 +265,7 @@ pub struct Node {
long,
value_name = "PORT",
help = "The UDP port that discovery will listen on over IPv6 if listening over \
both IPv4 and IPv6. Defaults to `port6`",
both IPv4 and IPv6. Defaults to `discovery_port`",
action = ArgAction::Set,
)]
pub discovery_port6: Option<u16>,
Expand Down Expand Up @@ -468,6 +475,7 @@ pub struct Node {

#[clap(
long,
value_delimiter = ',',
help = "Override size for a specific queue. Needs to be of the format \"queue_name=42\".",
hide = true,
display_order = 0
Expand Down
2 changes: 1 addition & 1 deletion anchor/client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ pub fn parse_listening_addresses(cli_args: &Node) -> Result<ListenAddress, Strin
.then(unused_port::unused_udp6_port)
.transpose()?
.or(cli_args.discovery_port6)
.unwrap_or(ipv6_tcp_port);
.unwrap_or(ipv4_disc_port);
let ipv6_quic_port = cli_args
.use_zero_ports
.then(unused_port::unused_udp6_port)
Expand Down
6 changes: 3 additions & 3 deletions anchor/network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use ssv_types::domain_type::DomainType;
const DEFAULT_NETWORK_DIR: &str = ".anchor/network";

pub const DEFAULT_IPV4_ADDRESS: Ipv4Addr = Ipv4Addr::UNSPECIFIED;
pub const DEFAULT_TCP_PORT: u16 = 9100u16;
pub const DEFAULT_DISC_PORT: u16 = 9100u16;
pub const DEFAULT_QUIC_PORT: u16 = 9101u16;
pub const DEFAULT_TCP_PORT: u16 = 13001;
pub const DEFAULT_DISC_PORT: u16 = 12001;
pub const DEFAULT_QUIC_PORT: u16 = 13002;

/// Configuration for setting up the p2p network.
#[derive(Clone)]
Expand Down
2 changes: 1 addition & 1 deletion book/src/advanced_networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Anchor's networking stack is closely based on Lighthouse's. We refer to
but want to outline several important differences:

- Currently, Anchor does not support UPnP.
- Anchor uses ports 9100 (TCP and UDP) and 9101 (UDP only) by default.
- Anchor uses ports 12001 (UDP), 13001 (TCP), and 9101 (UDP) by default.
- Anchor does not yet support ENR auto-update - we therefore recommend manually setting publicly reachable ports via the
`--enr*-port` CLI parameters to advertise your node as reachable on the network.
8 changes: 4 additions & 4 deletions book/src/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ anchor node [OPTIONS]
| --- | --- | ---|
| `--metrics` | Enable metrics server | Disabled |
| `--metrics-address <ADDRESS>` | Listen address for metrics server | `127.0.0.1` if `--metrics` is set |
| `--metrics-port <PORT>` | Listen port for metrics server | `5164` if `--metrics` is set |
| `--metrics-port <PORT>` | Listen port for metrics server | `15000` if `--metrics` is set |

#### Network Options

| Option | Description | Default |
| --- | --- | ---|
| `--listen-address <ADDRESS>` | Network address to listen for UDP & TCP connections | `0.0.0.0` |
| `--port <PORT>` | Base port for all network connections | `9100` |
| `--port <PORT>` | Base port for all network connections | `13001` |
| `--port6 <PORT>` | Base port for IPv6 network connections | Same as `--port` |
| `--discovery-port <PORT>` | UDP port for discovery | Same as `--port` |
| `--discovery-port6 <PORT>` | UDP port for IPv6 discovery | Same as `--port6` |
| `--discovery-port <PORT>` | UDP port for discovery | `12001` |
| `--discovery-port6 <PORT>` | UDP port for IPv6 discovery | Same as `--discovery-port` |
| `--quic-port <PORT>` | UDP port for QUIC protocol | `--port` + 1 |
| `--quic-port6 <PORT>` | UDP port for IPv6 QUIC protocol | `--port6` + 1 |
| `--boot-nodes <NODES>` | Comma-separated ENRs or Multiaddrs to bootstrap the network | None|
Expand Down