Struct aptos_data_client::aptosnet::AptosNetDataClient
source · [−]pub struct AptosNetDataClient { /* private fields */ }Expand description
An AptosDataClient that fulfills requests from remote peers’ Storage Service
over AptosNet.
The AptosNetDataClient:
- Sends requests to connected Aptos peers.
- Does basic type conversions and error handling on the responses.
- Routes requests to peers that advertise availability for that data.
- Maintains peer scores based on each peer’s observed quality of service and upper client reports of invalid or malicious data.
- Selects high quality peers to send each request to.
- Exposes a condensed data summary of our peers’ data advertisements.
The client currently assumes 1-request => 1-response. Streaming responses are handled at an upper layer.
The client is expected to be cloneable and usable from many concurrent tasks and/or threads.
Implementations
sourceimpl AptosNetDataClient
impl AptosNetDataClient
pub fn new(
data_client_config: AptosDataClientConfig,
storage_service_config: StorageServiceConfig,
time_service: TimeService,
network_client: StorageServiceClient,
runtime: Option<Handle>
) -> (Self, DataSummaryPoller)
Trait Implementations
sourceimpl AptosDataClient for AptosNetDataClient
impl AptosDataClient for AptosNetDataClient
sourcefn get_global_data_summary(&self) -> GlobalDataSummary
fn get_global_data_summary(&self) -> GlobalDataSummary
Returns a global summary of the data currently available in the network. Read more
sourcefn get_account_states_with_proof<'life0, 'async_trait>(
&'life0 self,
version: u64,
start_account_index: u64,
end_account_index: u64
) -> Pin<Box<dyn Future<Output = Result<Response<StateValueChunkWithProof>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_account_states_with_proof<'life0, 'async_trait>(
&'life0 self,
version: u64,
start_account_index: u64,
end_account_index: u64
) -> Pin<Box<dyn Future<Output = Result<Response<StateValueChunkWithProof>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns a single account states chunk with proof, containing the accounts from start to end index (inclusive) at the specified version. The proof version is the same as the specified version. Read more
sourcefn get_epoch_ending_ledger_infos<'life0, 'async_trait>(
&'life0 self,
start_epoch: Epoch,
expected_end_epoch: Epoch
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<LedgerInfoWithSignatures>>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_epoch_ending_ledger_infos<'life0, 'async_trait>(
&'life0 self,
start_epoch: Epoch,
expected_end_epoch: Epoch
) -> Pin<Box<dyn Future<Output = Result<Response<Vec<LedgerInfoWithSignatures>>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns all epoch ending ledger infos between start and end (inclusive). If the data cannot be fetched (e.g., the number of epochs is too large), an error is returned. Read more
sourcefn get_new_transaction_outputs_with_proof<'life0, 'async_trait>(
&'life0 self,
known_version: Version,
known_epoch: Epoch
) -> Pin<Box<dyn Future<Output = Result<Response<(TransactionOutputListWithProof, LedgerInfoWithSignatures)>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_new_transaction_outputs_with_proof<'life0, 'async_trait>(
&'life0 self,
known_version: Version,
known_epoch: Epoch
) -> Pin<Box<dyn Future<Output = Result<Response<(TransactionOutputListWithProof, LedgerInfoWithSignatures)>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns a new transaction output list with proof. Versions start at
known_version + 1 and known_epoch (inclusive). The end version
and proof version are specified by the server. If the data cannot be
fetched, an error is returned. Read more
sourcefn get_new_transactions_with_proof<'life0, 'async_trait>(
&'life0 self,
known_version: Version,
known_epoch: Epoch,
include_events: bool
) -> Pin<Box<dyn Future<Output = Result<Response<(TransactionListWithProof, LedgerInfoWithSignatures)>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_new_transactions_with_proof<'life0, 'async_trait>(
&'life0 self,
known_version: Version,
known_epoch: Epoch,
include_events: bool
) -> Pin<Box<dyn Future<Output = Result<Response<(TransactionListWithProof, LedgerInfoWithSignatures)>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns a new transaction list with proof. Versions start at
known_version + 1 and known_epoch (inclusive). The end version
and proof version are specified by the server. If the data cannot be
fetched, an error is returned. Read more
sourcefn get_number_of_account_states<'life0, 'async_trait>(
&'life0 self,
version: Version
) -> Pin<Box<dyn Future<Output = Result<Response<u64>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_number_of_account_states<'life0, 'async_trait>(
&'life0 self,
version: Version
) -> Pin<Box<dyn Future<Output = Result<Response<u64>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the number of account states at the specified version.
sourcefn get_transaction_outputs_with_proof<'life0, 'async_trait>(
&'life0 self,
proof_version: Version,
start_version: Version,
end_version: Version
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionOutputListWithProof>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_transaction_outputs_with_proof<'life0, 'async_trait>(
&'life0 self,
proof_version: Version,
start_version: Version,
end_version: Version
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionOutputListWithProof>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns a transaction output list with proof object, with transaction
outputs from start to end versions (inclusive). The proof is relative to
the specified proof_version. If the data cannot be fetched (e.g., the
number of transaction outputs is too large), an error is returned. Read more
sourcefn get_transactions_with_proof<'life0, 'async_trait>(
&'life0 self,
proof_version: Version,
start_version: Version,
end_version: Version,
include_events: bool
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionListWithProof>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_transactions_with_proof<'life0, 'async_trait>(
&'life0 self,
proof_version: Version,
start_version: Version,
end_version: Version,
include_events: bool
) -> Pin<Box<dyn Future<Output = Result<Response<TransactionListWithProof>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns a transaction list with proof object, with transactions from
start to end versions (inclusive). The proof is relative to the specified
proof_version. If include_events is true, events are included in the
proof. If the data cannot be fetched (e.g., the number of transactions is
too large), an error is returned. Read more
sourceimpl Clone for AptosNetDataClient
impl Clone for AptosNetDataClient
sourcefn clone(&self) -> AptosNetDataClient
fn clone(&self) -> AptosNetDataClient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for AptosNetDataClient
impl Send for AptosNetDataClient
impl Sync for AptosNetDataClient
impl Unpin for AptosNetDataClient
impl UnwindSafe for AptosNetDataClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more