Skip to content

Commit 53a5e0b

Browse files
committed
Allow multiple listen addresses
1 parent f6a83a1 commit 53a5e0b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

config/runtime.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ switches = [
1818
log_file: :string,
1919
beacon_api: :boolean,
2020
beacon_api_port: :integer,
21-
listen_address: :string,
21+
listen_address: [:string, :keep],
2222
discovery_port: :integer,
2323
boot_nodes: :string,
2424
keystore_file: :string,
@@ -123,7 +123,7 @@ bootnodes =
123123
config :lambda_ethereum_consensus, :libp2p,
124124
port: discovery_port,
125125
bootnodes: bootnodes,
126-
listen_addr: listen_address
126+
listen_addr: [listen_address]
127127

128128
# Engine API
129129

lib/lambda_ethereum_consensus/beacon/beacon_node.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ defmodule LambdaEthereumConsensus.Beacon.BeaconNode do
8383
port = Keyword.fetch!(config, :port)
8484
bootnodes = Keyword.fetch!(config, :bootnodes)
8585

86-
listen_addr = Keyword.fetch!(config, :listen_addr) |> parse_listen_addr()
86+
listen_addr = Keyword.fetch!(config, :listen_addr) |> Enum.map(&parse_listen_addr/1)
8787

8888
if Enum.empty?(bootnodes) do
8989
Logger.warning("No bootnodes configured.")
@@ -97,8 +97,6 @@ defmodule LambdaEthereumConsensus.Beacon.BeaconNode do
9797
]
9898
end
9999

100-
defp parse_listen_addr([]), do: []
101-
102100
defp parse_listen_addr(addr) do
103101
case String.split(addr, ":") do
104102
[ip, port] ->

0 commit comments

Comments
 (0)