@@ -12,7 +12,9 @@ switches = [
12
12
metrics: :boolean ,
13
13
metrics_port: :integer ,
14
14
validator_file: :string ,
15
- log_file: :string
15
+ log_file: :string ,
16
+ beacon_api: :boolean ,
17
+ beacon_api_port: :integer
16
18
]
17
19
18
20
is_testing = Config . config_env ( ) == :test
@@ -36,6 +38,8 @@ testnet_dir = Keyword.get(args, :testnet_dir)
36
38
enable_metrics = Keyword . get ( args , :metrics , false )
37
39
metrics_port = Keyword . get ( args , :metrics_port , if ( enable_metrics , do: 9568 , else: nil ) )
38
40
validator_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 )
39
43
40
44
config :lambda_ethereum_consensus , LambdaEthereumConsensus.ForkChoice ,
41
45
checkpoint_sync_url: checkpoint_sync_url
@@ -110,6 +114,18 @@ config :lambda_ethereum_consensus, EngineApi,
110
114
implementation: implementation ,
111
115
version: "2.0"
112
116
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
+
113
129
# Validator
114
130
#
115
131
# `validator_file` should be a file with two non-empty lines, the first being
0 commit comments