Struct solana_client::tpu_client::TpuClient
source · [−]pub struct TpuClient { /* private fields */ }
Expand description
Client which sends transactions directly to the current leader’s TPU port over UDP. The client uses RPC to determine the current leader and fetch node contact info
Implementations
sourceimpl TpuClient
impl TpuClient
sourcepub fn send_transaction(&self, transaction: &Transaction) -> bool
pub fn send_transaction(&self, transaction: &Transaction) -> bool
Serialize and send transaction to the current and upcoming leader TPUs according to fanout size
sourcepub fn send_wire_transaction(&self, wire_transaction: Vec<u8>) -> bool
pub fn send_wire_transaction(&self, wire_transaction: Vec<u8>) -> bool
Send a wire transaction to the current and upcoming leader TPUs according to fanout size
sourcepub fn try_send_transaction(
&self,
transaction: &Transaction
) -> TransportResult<()>
pub fn try_send_transaction(
&self,
transaction: &Transaction
) -> TransportResult<()>
Serialize and send transaction to the current and upcoming leader TPUs according to fanout size Returns the last error if all sends fail
sourcepub fn new(
rpc_client: Arc<RpcClient>,
websocket_url: &str,
config: TpuClientConfig
) -> Result<Self, TpuSenderError>
pub fn new(
rpc_client: Arc<RpcClient>,
websocket_url: &str,
config: TpuClientConfig
) -> Result<Self, TpuSenderError>
Create a new client that disconnects when dropped
sourcepub fn new_with_connection_cache(
rpc_client: Arc<RpcClient>,
websocket_url: &str,
config: TpuClientConfig,
connection_cache: Arc<ConnectionCache>
) -> Result<Self, TpuSenderError>
pub fn new_with_connection_cache(
rpc_client: Arc<RpcClient>,
websocket_url: &str,
config: TpuClientConfig,
connection_cache: Arc<ConnectionCache>
) -> Result<Self, TpuSenderError>
Create a new client that disconnects when dropped
pub fn send_and_confirm_messages_with_spinner<T: Signers>(
&self,
messages: &[Message],
signers: &T
) -> Result<Vec<Option<TransactionError>>, TpuSenderError>
pub fn rpc_client(&self) -> &RpcClient
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for TpuClient
impl Send for TpuClient
impl Sync for TpuClient
impl Unpin for TpuClient
impl !UnwindSafe for TpuClient
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more