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_MAX_RECIEVE_WINDOW_SIZE: u64 = 24 * 1024 * 1024; // 24 MBs
|
||||||
pub const DEFAULT_CONNECTION_TIMEOUT: u64 = 10;
|
pub const DEFAULT_CONNECTION_TIMEOUT: u64 = 10;
|
||||||
pub const DEFAULT_MAX_NB_CONNECTIONS: 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 DEFAULT_ACK_EXPONENT: u64 = 3;
|
||||||
pub const ALPN_GEYSER_PROTOCOL_ID: &[u8] = b"geyser";
|
pub const ALPN_GEYSER_PROTOCOL_ID: &[u8] = b"geyser";
|
||||||
pub const MAX_DATAGRAM_SIZE: usize = 1350; // MAX: 65527
|
pub const MAX_DATAGRAM_SIZE: usize = 1350; // MAX: 65527
|
||||||
pub const DEFAULT_ENABLE_PACING: bool = true;
|
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;
|
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));
|
sleep(Duration::from_secs(1));
|
||||||
let mut filters = vec![Filter::Slot, Filter::BlockMeta];
|
let mut filters = vec![Filter::Slot, Filter::BlockMeta];
|
||||||
|
filters.push(Filter::BlockAll);
|
||||||
if args.blocks_instead_of_accounts {
|
filters.push(Filter::AccountsAll);
|
||||||
filters.push(Filter::BlockAll);
|
|
||||||
} else {
|
|
||||||
filters.push(Filter::AccountsAll);
|
|
||||||
filters.push(Filter::TransactionsAll);
|
|
||||||
};
|
|
||||||
|
|
||||||
println!("Subscribing");
|
println!("Subscribing");
|
||||||
client.subscribe(filters).unwrap();
|
client.subscribe(filters).unwrap();
|
||||||
println!("Subscribed");
|
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;
|
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||||
let mut filters = vec![Filter::Slot, Filter::BlockMeta];
|
let mut filters = vec![Filter::Slot, Filter::BlockMeta];
|
||||||
|
filters.push(Filter::BlockAll);
|
||||||
if args.blocks_instead_of_accounts {
|
filters.push(Filter::AccountsAll);
|
||||||
filters.push(Filter::BlockAll);
|
|
||||||
} else {
|
|
||||||
filters.push(Filter::AccountsAll);
|
|
||||||
filters.push(Filter::TransactionsAll);
|
|
||||||
};
|
|
||||||
|
|
||||||
println!("Subscribing");
|
println!("Subscribing");
|
||||||
client.subscribe(filters).await.unwrap();
|
client.subscribe(filters).await.unwrap();
|
||||||
|
@ -375,12 +364,16 @@ pub async fn main() {
|
||||||
if let Some(rpc_url) = rpc_url {
|
if let Some(rpc_url) = rpc_url {
|
||||||
let cluster_slot = client_stats.cluster_slot.clone();
|
let cluster_slot = client_stats.cluster_slot.clone();
|
||||||
let rpc = RpcClient::new(rpc_url);
|
let rpc = RpcClient::new(rpc_url);
|
||||||
|
let mut last_slot = 0;
|
||||||
std::thread::spawn(move || loop {
|
std::thread::spawn(move || loop {
|
||||||
sleep(Duration::from_millis(100));
|
sleep(Duration::from_millis(200));
|
||||||
let slot = rpc
|
if let Ok(slot) = rpc
|
||||||
.get_slot_with_commitment(CommitmentConfig::processed())
|
.get_slot_with_commitment(CommitmentConfig::processed()) {
|
||||||
.unwrap();
|
if last_slot < slot {
|
||||||
cluster_slot.store(slot, std::sync::atomic::Ordering::Relaxed);
|
last_slot = slot;
|
||||||
|
cluster_slot.store(slot, std::sync::atomic::Ordering::Relaxed);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue