@@ -12,7 +12,9 @@ switches = [
1212 metrics: :boolean ,
1313 metrics_port: :integer ,
1414 validator_file: :string ,
15- log_file: :string
15+ log_file: :string ,
16+ beacon_api: :boolean ,
17+ beacon_api_port: :integer
1618]
1719
1820is_testing = Config . config_env ( ) == :test
@@ -36,6 +38,8 @@ testnet_dir = Keyword.get(args, :testnet_dir)
3638enable_metrics = Keyword . get ( args , :metrics , false )
3739metrics_port = Keyword . get ( args , :metrics_port , if ( enable_metrics , do: 9568 , else: nil ) )
3840validator_file = Keyword . get ( args , :validator_file )
41+ enable_beacon_api = Keyword . get ( args , :beacon_api , false )
42+ beacon_api_port = Keyword . get ( args , :beacon_api_port , 4000 )
3943
4044config :lambda_ethereum_consensus , LambdaEthereumConsensus.ForkChoice ,
4145 checkpoint_sync_url: checkpoint_sync_url
@@ -110,6 +114,18 @@ config :lambda_ethereum_consensus, EngineApi,
110114 implementation: implementation ,
111115 version: "2.0"
112116
117+ # Beacon API
118+ alias BeaconApi
119+
120+ config :lambda_ethereum_consensus , BeaconApi.Endpoint ,
121+ server: enable_beacon_api ,
122+ http: [ port: beacon_api_port ] ,
123+ url: [ host: "localhost" ] ,
124+ render_errors: [
125+ formats: [ json: BeaconApi.ErrorJSON ] ,
126+ layout: false
127+ ]
128+
113129# Validator
114130#
115131# `validator_file` should be a file with two non-empty lines, the first being
0 commit comments