Skip to content

Commit

Permalink
running
Browse files Browse the repository at this point in the history
  • Loading branch information
coachchucksol committed Jan 31, 2025
1 parent 524ecd2 commit a695469
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,14 @@ pub enum ProgramCommand {
Keeper {
#[arg(
long,
env,
default_value_t = 600_000, // 10 minutes
help = "Keeper error timeout in milliseconds"
)]
loop_timeout_ms: u64,
#[arg(
long,
env,
default_value_t = 10_000, // 10 seconds
help = "Keeper error timeout in milliseconds"
)]
Expand Down
19 changes: 17 additions & 2 deletions cli/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,12 @@ pub async fn crank_switchboard(handler: &CliHandler, switchboard_feed: &Pubkey)
let queue_key = Pubkey::from_str("A43DyUGA7s8eXPxqEjJY6EBu1KKbNgfxF8h17VAHn13w").unwrap();

let queue = QueueAccountData::load(client, &queue_key).await?;
let gw = &queue.fetch_gateways(client).await?[0];
let gateways = &queue.fetch_gateways(client).await?;
if gateways.is_empty() {
return Err(anyhow!("No gateways found"));
}

let gw = &gateways[0];
let crossbar = CrossbarClient::default();
let (ix, _, _, _) = PullFeed::fetch_update_ix(
switchboard_context.clone(),
Expand Down Expand Up @@ -843,7 +848,17 @@ pub async fn set_weight_with_st_mint(
WeightTable::find_program_address(&handler.tip_router_program_id, &ncn, epoch);

// Crank Switchboard
crank_switchboard(handler, switchboard_feed).await?;
let result = crank_switchboard(handler, switchboard_feed).await;
if let Err(e) = result {
log::error!(
"\n\nFailed to crank switchboard - will need manual crank at {}\n\nError:\n{:?}\n",
format!(
"https://ondemand.switchboard.xyz/solana/mainnet/feed/{}",
switchboard_feed
),
e
);
}

let set_weight_ix = SwitchboardSetWeightBuilder::new()
.ncn(ncn)
Expand Down

0 comments on commit a695469

Please sign in to comment.