Move and rename cluster_client
This commit is contained in:
committed by
Tyera Eulberg
parent
ef7f30e09f
commit
1e8e99cc3e
17
client/src/client.rs
Normal file
17
client/src/client.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::thin_client::ThinClient;
|
||||
use std::net::SocketAddr;
|
||||
use std::time::Duration;
|
||||
|
||||
pub fn create_client((rpc, tpu): (SocketAddr, SocketAddr), range: (u16, u16)) -> ThinClient {
|
||||
let (_, transactions_socket) = solana_netutil::bind_in_range(range).unwrap();
|
||||
ThinClient::new(rpc, tpu, transactions_socket)
|
||||
}
|
||||
|
||||
pub fn create_client_with_timeout(
|
||||
(rpc, tpu): (SocketAddr, SocketAddr),
|
||||
range: (u16, u16),
|
||||
timeout: Duration,
|
||||
) -> ThinClient {
|
||||
let (_, transactions_socket) = solana_netutil::bind_in_range(range).unwrap();
|
||||
ThinClient::new_with_timeout(rpc, tpu, transactions_socket, timeout)
|
||||
}
|
@@ -1,3 +1,4 @@
|
||||
pub mod client;
|
||||
pub mod rpc_mock;
|
||||
pub mod rpc_request;
|
||||
pub mod thin_client;
|
||||
|
Reference in New Issue
Block a user