22use :: {
33 anyhow:: Result ,
44 clap:: Parser ,
5+ jito_restaking_core:: config:: Config as RestakingConfig ,
56 log:: { error, info} ,
67 solana_metrics:: { datapoint_error, datapoint_info, set_host_id} ,
78 solana_rpc_client:: nonblocking:: rpc_client:: RpcClient ,
89 solana_sdk:: { pubkey:: Pubkey , signer:: keypair:: read_keypair_file} ,
9- std:: process:: Command ,
10- std:: { str:: FromStr , sync:: Arc , time:: Duration } ,
10+ std:: { process:: Command , str:: FromStr , sync:: Arc , time:: Duration } ,
1111 tip_router_operator_cli:: {
1212 backup_snapshots:: BackupSnapshotMonitor ,
1313 claim:: { claim_mev_tips_with_emit, emit_claim_mev_tips_metrics} ,
@@ -16,6 +16,7 @@ use ::{
1616 ledger_utils:: get_bank_from_snapshot_at_slot,
1717 load_bank_from_snapshot, meta_merkle_tree_path, process_epoch, read_merkle_tree_collection,
1818 read_stake_meta_collection, reclaim,
19+ restaking:: RestakingHandler ,
1920 submit:: { submit_recent_epochs_to_ncn, submit_to_ncn} ,
2021 tip_distribution_stats:: get_tip_distribution_stats,
2122 tip_router:: get_ncn_config,
@@ -96,6 +97,7 @@ async fn main() -> Result<()> {
9697 priority_fee_distribution_program_id,
9798 tip_payment_program_id,
9899 tip_router_program_id,
100+ restaking_program_id,
99101 save_snapshot,
100102 num_monitored_epochs,
101103 override_target_slot,
@@ -132,6 +134,21 @@ async fn main() -> Result<()> {
132134 let rpc_url = cli. rpc_url . clone ( ) ;
133135 let claim_tips_epoch_filepath = cli. claim_tips_epoch_filepath . clone ( ) ;
134136 let cli_clone: Cli = cli. clone ( ) ;
137+ let operator_address = cli. operator_address . clone ( ) ;
138+ let cluster = cli. cluster . clone ( ) ;
139+ let restaking_config_address =
140+ RestakingConfig :: find_program_address ( & restaking_program_id) . 0 ;
141+
142+ let restaking_handler = RestakingHandler :: new (
143+ rpc_client. clone ( ) ,
144+ restaking_program_id,
145+ restaking_config_address,
146+ ncn_address,
147+ Pubkey :: from_str ( cli. operator_address . as_str ( ) ) . unwrap ( ) ,
148+ keypair. clone ( ) ,
149+ ) ;
150+ restaking_handler. warmup_operator ( ) . await ?;
151+ restaking_handler. create_operator_vault_tickets ( ) . await ?;
135152
136153 if !backup_snapshots_dir. exists ( ) {
137154 info ! (
@@ -141,9 +158,6 @@ async fn main() -> Result<()> {
141158 std:: fs:: create_dir_all ( & backup_snapshots_dir) ?;
142159 }
143160
144- let operator_address = cli. operator_address . clone ( ) ;
145- let cluster = cli. cluster . clone ( ) ;
146-
147161 let try_catchup = tip_router_operator_cli:: solana_cli:: catchup (
148162 cli. rpc_url . to_owned ( ) ,
149163 cli. localhost_port ,
0 commit comments