updating defaults and client example
This commit is contained in:
parent
880897ab0a
commit
0659be26b6
|
@ -4,10 +4,10 @@ pub const MAX_ALLOWED_PARTIAL_RESPONSES: u64 = DEFAULT_MAX_STREAMS * 3 / 4;
|
|||
pub const DEFAULT_MAX_RECIEVE_WINDOW_SIZE: u64 = 24 * 1024 * 1024; // 24 MBs
|
||||
pub const DEFAULT_CONNECTION_TIMEOUT: u64 = 10;
|
||||
pub const DEFAULT_MAX_NB_CONNECTIONS: u64 = 10;
|
||||
pub const DEFAULT_MAX_ACK_DELAY: u64 = 200;
|
||||
pub const DEFAULT_MAX_ACK_DELAY: u64 = 25;
|
||||
pub const DEFAULT_ACK_EXPONENT: u64 = 3;
|
||||
pub const ALPN_GEYSER_PROTOCOL_ID: &[u8] = b"geyser";
|
||||
pub const MAX_DATAGRAM_SIZE: usize = 1350; // MAX: 65527
|
||||
pub const DEFAULT_ENABLE_PACING: bool = true;
|
||||
pub const DEFAULT_USE_CC_BBR: bool = true;
|
||||
pub const DEFAULT_USE_CC_BBR: bool = false;
|
||||
pub const DEFAULT_INCREMENTAL_PRIORITY: bool = true;
|
||||
|
|
|
@ -131,14 +131,8 @@ fn blocking(args: Args, client_stats: ClientStats, break_thread: Arc<AtomicBool>
|
|||
|
||||
sleep(Duration::from_secs(1));
|
||||
let mut filters = vec![Filter::Slot, Filter::BlockMeta];
|
||||
|
||||
if args.blocks_instead_of_accounts {
|
||||
filters.push(Filter::BlockAll);
|
||||
} else {
|
||||
filters.push(Filter::AccountsAll);
|
||||
filters.push(Filter::TransactionsAll);
|
||||
};
|
||||
|
||||
filters.push(Filter::BlockAll);
|
||||
filters.push(Filter::AccountsAll);
|
||||
println!("Subscribing");
|
||||
client.subscribe(filters).unwrap();
|
||||
println!("Subscribed");
|
||||
|
@ -244,13 +238,8 @@ async fn non_blocking(args: Args, client_stats: ClientStats, break_thread: Arc<A
|
|||
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
let mut filters = vec![Filter::Slot, Filter::BlockMeta];
|
||||
|
||||
if args.blocks_instead_of_accounts {
|
||||
filters.push(Filter::BlockAll);
|
||||
} else {
|
||||
filters.push(Filter::AccountsAll);
|
||||
filters.push(Filter::TransactionsAll);
|
||||
};
|
||||
filters.push(Filter::BlockAll);
|
||||
filters.push(Filter::AccountsAll);
|
||||
|
||||
println!("Subscribing");
|
||||
client.subscribe(filters).await.unwrap();
|
||||
|
@ -375,12 +364,16 @@ pub async fn main() {
|
|||
if let Some(rpc_url) = rpc_url {
|
||||
let cluster_slot = client_stats.cluster_slot.clone();
|
||||
let rpc = RpcClient::new(rpc_url);
|
||||
let mut last_slot = 0;
|
||||
std::thread::spawn(move || loop {
|
||||
sleep(Duration::from_millis(100));
|
||||
let slot = rpc
|
||||
.get_slot_with_commitment(CommitmentConfig::processed())
|
||||
.unwrap();
|
||||
cluster_slot.store(slot, std::sync::atomic::Ordering::Relaxed);
|
||||
sleep(Duration::from_millis(200));
|
||||
if let Ok(slot) = rpc
|
||||
.get_slot_with_commitment(CommitmentConfig::processed()) {
|
||||
if last_slot < slot {
|
||||
last_slot = slot;
|
||||
cluster_slot.store(slot, std::sync::atomic::Ordering::Relaxed);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue