File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ struct Args {
31
31
#[ arg( long, env) ]
32
32
jwt_path : Option < PathBuf > ,
33
33
34
+ /// JWT token for authentication for the builder
35
+ #[ arg( long, env) ]
36
+ builder_jwt_token : Option < String > ,
37
+
38
+ /// Path to the JWT secret file for the builder
39
+ #[ arg( long, env) ]
40
+ builder_jwt_path : Option < PathBuf > ,
41
+
34
42
/// URL of the local l2 execution engine
35
43
#[ arg( long, env) ]
36
44
l2_url : String ,
@@ -91,11 +99,21 @@ async fn main() -> Result<()> {
91
99
}
92
100
} ;
93
101
102
+ let builder_jwt_secret = match ( args. builder_jwt_path , args. builder_jwt_token ) {
103
+ ( Some ( file) , None ) => {
104
+ JwtSecret :: from_file ( & file) . map_err ( |e| Error :: InvalidArgs ( e. to_string ( ) ) ) ?
105
+ }
106
+ ( None , Some ( secret) ) => {
107
+ JwtSecret :: from_hex ( secret) . map_err ( |e| Error :: InvalidArgs ( e. to_string ( ) ) ) ?
108
+ }
109
+ _ => jwt_secret,
110
+ } ;
111
+
94
112
// Initialize the l2 client
95
113
let l2_client = create_client ( & args. l2_url , jwt_secret) ?;
96
114
97
115
// Initialize the builder client
98
- let builder_client = create_client ( & args. builder_url , jwt_secret ) ?;
116
+ let builder_client = create_client ( & args. builder_url , builder_jwt_secret ) ?;
99
117
100
118
let eth_engine_api = EthEngineApi :: new (
101
119
Arc :: new ( l2_client) ,
You can’t perform that action at this time.
0 commit comments