Struct diem_data_client::diemnet::DiemNetDataClient [−][src]
pub struct DiemNetDataClient { /* fields omitted */ }Expand description
A DiemDataClient that fulfills requests from remote peers’ Storage Service
over DiemNet.
The DiemNetDataClient:
- Sends requests to connected DiemNet 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
pub fn new(
data_client_config: DiemDataClientConfig,
storage_service_config: StorageServiceConfig,
time_service: TimeService,
network_client: StorageServiceClient
) -> (Self, DataSummaryPoller)
Trait Implementations
Returns a global summary of the data currently available in the network. Read more
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
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
Returns the number of account states at the specified version.
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
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,
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
Auto Trait Implementations
impl RefUnwindSafe for DiemNetDataClient
impl Send for DiemNetDataClient
impl Sync for DiemNetDataClient
impl Unpin for DiemNetDataClient
impl UnwindSafe for DiemNetDataClient
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self