@@ -124,9 +124,14 @@ impl Devnet {
124124 bootstrap_args. cardano_hard_fork_latest_era_at_epoch . to_string ( ) ,
125125 ) ;
126126
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+
127132 bootstrap_command
128133 . current_dir ( & bootstrap_args. devnet_scripts_dir )
129- . stdout ( Stdio :: null ( ) )
134+ // .stdout(Stdio::null())
130135 . kill_on_drop ( true ) ;
131136
132137 info ! ( "Bootstrapping the Devnet" ; "script" => & bootstrap_script_path. display( ) ) ;
@@ -230,20 +235,43 @@ impl Devnet {
230235 let mut run_command = Command :: new ( & run_script_path) ;
231236 run_command. current_dir ( & self . artifacts_dir ) . kill_on_drop ( true ) ;
232237
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( ) ) ;
234262
235263 let status = run_command
236264 . spawn ( )
237- . with_context ( || "Failed to start the devnet" ) ?
265+ . with_context ( || "Failed to start the DMQ devnet" ) ?
238266 . wait ( )
239267 . await
240- . with_context ( || "Error while starting the devnet" ) ?;
268+ . with_context ( || "Error while starting the DMQ devnet" ) ?;
241269 match status. code ( ) {
242270 Some ( 0 ) => Ok ( ( ) ) ,
243271 Some ( code) => Err ( anyhow ! ( RetryableDevnetError ( format!(
244- "Run devnet exited with status code: {code}"
272+ "Run DMQ devnet exited with status code: {code}"
245273 ) ) ) ) ,
246- None => Err ( anyhow ! ( "Run devnet terminated by signal" ) ) ,
274+ None => Err ( anyhow ! ( "Run DMQ devnet terminated by signal" ) ) ,
247275 }
248276 }
249277
0 commit comments