@@ -129,36 +129,21 @@ where
129129 log_file : self . log_file . clone ( ) ,
130130 } ;
131131
132- let serialized_config =
133- serde_json:: to_string ( & config) . map_err ( |e| MovementAptosError :: Internal ( e. into ( ) ) ) ?;
134- println ! ( "Serialized config: {:?}" , serialized_config) ;
135-
136- // create node_config data dir
137- let data_dir = self . node_config . get_data_dir ( ) ;
138- tokio:: fs:: create_dir_all ( data_dir)
139- . await
132+ let serialized_node_config_wrapper = serde_json:: to_string ( & config. node_config )
140133 . map_err ( |e| MovementAptosError :: Internal ( e. into ( ) ) ) ?;
141134
142- println ! ( "Data dir: {:?}" , data_dir) ;
143-
144- // write the config to the file
145- // seems to be blocking here
146- // perhaps somehow being opened in read?
147- tokio:: fs:: write ( config_path. clone ( ) , serialized_config)
148- . await
149- . map_err ( |e| MovementAptosError :: Internal ( e. into ( ) ) ) ?;
150- println ! ( "Config path: {:?}" , config_path) ;
151-
152135 // spawn the node in a new process
153136 println ! ( "Spawning node in process" ) ;
154137 let command = Command :: line (
155138 "movement-aptos" ,
156- vec ! [ "run" , "using " , "--config-path " , "config.json" ] ,
157- Some ( & self . workspace ) ,
139+ vec ! [ "run" , "where " , "--node-config " , & serialized_node_config_wrapper ] ,
140+ None , // Note the drop in working directory; now RocksDB will error.
158141 false ,
159142 vec ! [ ] ,
160143 vec ! [ ] ,
161144 ) ;
145+
146+ println ! ( "Spawning command." ) ;
162147 command. run ( ) . await . map_err ( |e| MovementAptosError :: Internal ( e. into ( ) ) ) ?;
163148
164149 Ok ( ( ) )
@@ -263,7 +248,7 @@ mod tests {
263248
264249 // You can comment and uncomment this to see that the rest api wait for is not causing the problem
265250 // tokio::time::sleep(tokio::time::Duration::from_secs(10)).await;
266- rest_api_state. wait_for ( tokio:: time:: Duration :: from_secs ( 10 ) ) . await ?;
251+ rest_api_state. wait_for ( tokio:: time:: Duration :: from_secs ( 30 ) ) . await ?;
267252
268253 println ! ( "ENDING MOVEMENT APTOS" ) ;
269254
0 commit comments