Skip to content

Commit

Permalink
make cli arg
Browse files Browse the repository at this point in the history
  • Loading branch information
jedleggett committed Aug 28, 2024
1 parent 6e4ed29 commit 6c383ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion relayer/src/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ impl RelayerImpl {
validator_packet_batch_size: usize,
forward_all: bool,
slot_lookahead: u64,
heartbeat_tick_time: u64,
) -> Self {
// receiver tracked as relayer_metrics.subscription_receiver_len
let (subscription_sender, subscription_receiver) =
Expand All @@ -451,6 +452,7 @@ impl RelayerImpl {
address_lookup_table_cache,
validator_packet_batch_size,
forward_all,
heartbeat_tick_time,
);
warn!("RelayerImpl thread exited with result {res:?}")
})
Expand Down Expand Up @@ -487,10 +489,11 @@ impl RelayerImpl {
address_lookup_table_cache: Arc<DashMap<Pubkey, AddressLookupTableAccount>>,
validator_packet_batch_size: usize,
forward_all: bool,
heartbeat_tick_time: u64,
) -> RelayerResult<()> {
let mut highest_slot = Slot::default();

let heartbeat_tick = crossbeam_channel::tick(Duration::from_millis(100));
let heartbeat_tick = crossbeam_channel::tick(Duration::from_millis(heartbeat_tick_time));
let metrics_tick = crossbeam_channel::tick(Duration::from_millis(1000));

let mut relayer_metrics = RelayerMetrics::new(
Expand Down
5 changes: 5 additions & 0 deletions transaction-relayer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ struct Args {
/// The slot lookahead to use when forwarding transactions
#[arg(long, env, default_value_t = 5)]
slot_lookahead: u64,

/// Time in milliseconds between heartbeat ticks
#[arg(long, env default_value_t = 100)]
heartbeat_tick_time: u64,
}

#[derive(Debug)]
Expand Down Expand Up @@ -536,6 +540,7 @@ fn main() {
args.validator_packet_batch_size,
args.forward_all,
args.slot_lookahead,
args.heartbeat_tick_time,
);

let priv_key = fs::read(&args.signing_key_pem_path).unwrap_or_else(|_| {
Expand Down

0 comments on commit 6c383ca

Please sign in to comment.