feat: added signature subscribe

This commit is contained in:
Lioncat2002 2022-11-22 19:10:48 +05:30
parent b19e4bdd62
commit 072e54a566
No known key found for this signature in database
1 changed files with 18 additions and 1 deletions

View File

@ -1,5 +1,5 @@
use solana_client::{
pubsub_client::{BlockSubscription, PubsubClientError},
pubsub_client::{BlockSubscription, PubsubClientError, SignatureSubscription},
tpu_client::TpuClientConfig,
};
use solana_pubsub_client::pubsub_client::{PubsubBlockClientSubscription, PubsubClient};
@ -114,6 +114,23 @@ impl LightRpcRequestProcessor {
)
}
fn subscribe_signature(
websocket_url: &String,
signature: &Signature,
commitment:CommitmentLevel
) -> std::result::Result<SignatureSubscription, PubsubClientError> {
PubsubClient::signature_subscribe(
websocket_url.as_str(),
signature,
Some(RpcSignatureSubscribeConfig {
commitment: Some(CommitmentConfig {
commitment,
}),
enable_received_notification: Some(false),
}),
)
}
fn build_thread_to_process_blocks(
reciever: Receiver<RpcResponse<RpcBlockUpdate>>,
context: &Arc<LiteRpcContext>,