Skip to content
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

feat: make beacon API port configurable #901

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 0 additions & 9 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ config :lambda_ethereum_consensus, LambdaEthereumConsensus.Telemetry, enable: tr
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason

# Configures the phoenix endpoint
config :lambda_ethereum_consensus, BeaconApi.Endpoint,
http: [port: 4000],
url: [host: "localhost"],
render_errors: [
formats: [json: BeaconApi.ErrorJSON],
layout: false
]

# Load minimal config by default, to allow schema checking
config :lambda_ethereum_consensus, ChainSpec,
config: MinimalConfig,
Expand Down
16 changes: 15 additions & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ switches = [
testnet_dir: :string,
metrics: :boolean,
metrics_port: :integer,
log_file: :string
log_file: :string,
beacon_api_port: :integer,
no_halt: :boolean
avilagaston9 marked this conversation as resolved.
Show resolved Hide resolved
]

is_testing = Config.config_env() == :test
Expand All @@ -30,6 +32,7 @@ end
network = Keyword.get(args, :network, "mainnet")
checkpoint_sync_url = Keyword.get(args, :checkpoint_sync_url)
execution_endpoint = Keyword.get(args, :execution_endpoint, "http://localhost:8551")
beacon_api_port = Keyword.get(args, :beacon_api_port, 4000)
jwt_path = Keyword.get(args, :execution_jwt)
testnet_dir = Keyword.get(args, :testnet_dir)
enable_metrics = Keyword.get(args, :metrics, false)
Expand Down Expand Up @@ -108,6 +111,17 @@ config :lambda_ethereum_consensus, EngineApi,
implementation: implementation,
version: "2.0"

# Beacon API
alias BeaconApi

config :lambda_ethereum_consensus, BeaconApi.Endpoint,
http: [port: beacon_api_port],
url: [host: "localhost"],
render_errors: [
formats: [json: BeaconApi.ErrorJSON],
layout: false
]

# Metrics

# Configures metrics
Expand Down
Loading