@@ -124,9 +124,14 @@ impl Devnet {
124
124
bootstrap_args. cardano_hard_fork_latest_era_at_epoch . to_string ( ) ,
125
125
) ;
126
126
127
+ // TODO: temporary implementation
128
+ let dmq_node_binary =
129
+ PathBuf :: from ( r"/home/jp/Works/Cardano/Mithril/ouroboros-network/result/bin" ) ;
130
+ bootstrap_command. env ( "DMQ_NODE_BINARY" , & dmq_node_binary) ;
131
+
127
132
bootstrap_command
128
133
. current_dir ( & bootstrap_args. devnet_scripts_dir )
129
- . stdout ( Stdio :: null ( ) )
134
+ // .stdout(Stdio::null())
130
135
. kill_on_drop ( true ) ;
131
136
132
137
info ! ( "Bootstrapping the Devnet" ; "script" => & bootstrap_script_path. display( ) ) ;
@@ -230,20 +235,43 @@ impl Devnet {
230
235
let mut run_command = Command :: new ( & run_script_path) ;
231
236
run_command. current_dir ( & self . artifacts_dir ) . kill_on_drop ( true ) ;
232
237
233
- info ! ( "Starting the Devnet" ; "script" => & run_script_path. display( ) ) ;
238
+ info ! ( "Starting the Cardano devnet" ; "script" => & run_script_path. display( ) ) ;
239
+
240
+ let status = run_command
241
+ . spawn ( )
242
+ . with_context ( || "Failed to start the Cardano devnet" ) ?
243
+ . wait ( )
244
+ . await
245
+ . with_context ( || "Error while starting the Cardano devnet" ) ?;
246
+ match status. code ( ) {
247
+ Some ( 0 ) => Ok ( ( ) ) ,
248
+ Some ( code) => Err ( anyhow ! ( RetryableDevnetError ( format!(
249
+ "Run Cardano devnet exited with status code: {code}"
250
+ ) ) ) ) ,
251
+ None => Err ( anyhow ! ( "Run Cardano devnet terminated by signal" ) ) ,
252
+ }
253
+ }
254
+
255
+ pub async fn run_dmq ( & self ) -> StdResult < ( ) > {
256
+ let run_script = "start-dmq.sh" ;
257
+ let run_script_path = self . artifacts_dir . join ( run_script) ;
258
+ let mut run_command = Command :: new ( & run_script_path) ;
259
+ run_command. current_dir ( & self . artifacts_dir ) . kill_on_drop ( true ) ;
260
+
261
+ info ! ( "Starting the DMQ devnet" ; "script" => & run_script_path. display( ) ) ;
234
262
235
263
let status = run_command
236
264
. spawn ( )
237
- . with_context ( || "Failed to start the devnet" ) ?
265
+ . with_context ( || "Failed to start the DMQ devnet" ) ?
238
266
. wait ( )
239
267
. await
240
- . with_context ( || "Error while starting the devnet" ) ?;
268
+ . with_context ( || "Error while starting the DMQ devnet" ) ?;
241
269
match status. code ( ) {
242
270
Some ( 0 ) => Ok ( ( ) ) ,
243
271
Some ( code) => Err ( anyhow ! ( RetryableDevnetError ( format!(
244
- "Run devnet exited with status code: {code}"
272
+ "Run DMQ devnet exited with status code: {code}"
245
273
) ) ) ) ,
246
- None => Err ( anyhow ! ( "Run devnet terminated by signal" ) ) ,
274
+ None => Err ( anyhow ! ( "Run DMQ devnet terminated by signal" ) ) ,
247
275
}
248
276
}
249
277
0 commit comments