@@ -40,6 +40,9 @@ async fn main() -> Result<()> {
4040
4141 set_host_id ( cli. operator_address . to_string ( ) ) ;
4242
43+ // Will panic if the user did not set --save-path or the deprecated --meta-merkle-tree-dir
44+ let save_path = cli. get_save_path ( ) ;
45+
4346 info ! (
4447 "CLI Arguments:
4548 keypair_path: {}
@@ -48,14 +51,16 @@ async fn main() -> Result<()> {
4851 ledger_path: {}
4952 full_snapshots_path: {:?}
5053 snapshot_output_dir: {}
51- backup_snapshots_dir: {}" ,
54+ backup_snapshots_dir: {}
55+ save_path: {}" ,
5256 cli. keypair_path,
5357 cli. operator_address,
5458 cli. rpc_url,
5559 cli. ledger_path. display( ) ,
5660 cli. full_snapshots_path,
5761 cli. snapshot_output_dir. display( ) ,
58- cli. backup_snapshots_dir. display( )
62+ cli. backup_snapshots_dir. display( ) ,
63+ save_path. display( ) ,
5964 ) ;
6065
6166 cli. create_save_path ( ) ;
@@ -132,7 +137,7 @@ async fn main() -> Result<()> {
132137 let cli_clone: Cli = cli. clone ( ) ;
133138 // Track incremental snapshots and backup to `backup_snapshots_dir`
134139 tokio:: spawn ( async move {
135- let save_path = cli_clone. save_path ;
140+ let save_path = cli_clone. get_save_path ( ) ;
136141 loop {
137142 if let Err ( e) = BackupSnapshotMonitor :: new (
138143 & rpc_url,
@@ -206,7 +211,7 @@ async fn main() -> Result<()> {
206211 epoch,
207212 set_merkle_roots,
208213 } => {
209- let meta_merkle_tree_path = cli. save_path . join ( meta_merkle_tree_file_name ( epoch) ) ;
214+ let meta_merkle_tree_path = cli. get_save_path ( ) . join ( meta_merkle_tree_file_name ( epoch) ) ;
210215 info ! (
211216 "Submitting epoch {} from {}..." ,
212217 epoch,
@@ -277,7 +282,7 @@ async fn main() -> Result<()> {
277282 & Arc :: new ( bank) ,
278283 & tip_distribution_program_id,
279284 & tip_payment_program_id,
280- & cli . save_path ,
285+ & save_path,
281286 save,
282287 ) ;
283288 }
@@ -289,7 +294,7 @@ async fn main() -> Result<()> {
289294 } => {
290295 // Load the stake_meta_collection from disk
291296 let stake_meta_collection = match StakeMetaCollection :: new_from_file (
292- & cli. save_path . join ( stake_meta_file_name ( epoch) ) ,
297+ & cli. get_save_path ( ) . join ( stake_meta_file_name ( epoch) ) ,
293298 ) {
294299 Ok ( stake_meta_collection) => stake_meta_collection,
295300 Err ( e) => panic ! ( "{}" , e) ,
@@ -309,14 +314,14 @@ async fn main() -> Result<()> {
309314 epoch,
310315 & ncn_address,
311316 protocol_fee_bps,
312- & cli . save_path ,
317+ & save_path,
313318 save,
314319 ) ;
315320 }
316321 Commands :: CreateMetaMerkleTree { epoch, save } => {
317322 // Load the stake_meta_collection from disk
318323 let merkle_tree_collection = match GeneratedMerkleTreeCollection :: new_from_file (
319- & cli . save_path . join ( merkle_tree_collection_file_name ( epoch) ) ,
324+ & save_path. join ( merkle_tree_collection_file_name ( epoch) ) ,
320325 ) {
321326 Ok ( merkle_tree_collection) => merkle_tree_collection,
322327 Err ( e) => panic ! ( "{}" , e) ,
@@ -326,7 +331,7 @@ async fn main() -> Result<()> {
326331 cli. operator_address ,
327332 merkle_tree_collection,
328333 epoch,
329- & cli . save_path ,
334+ & save_path,
330335 save,
331336 ) ;
332337 }
0 commit comments