OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::archiver::client Class Reference

Retrieves blocks from a remote archiver via the network. More...

#include <client.hpp>

Public Member Functions

 client (network::endpoint_t endpoint, std::shared_ptr< logging::log > logger)
 Constructor.
 
 client ()=delete
 
auto init () -> bool
 Attempts to connect to the archiver.
 
auto get_block (uint64_t height) -> std::optional< cbdc::atomizer::block >
 Retrieves the block at the given height from the archiver.
 

Detailed Description

Retrieves blocks from a remote archiver via the network.

Warning
Not thread-safe. Only one thread can use the client without synchronization.

Definition at line 24 of file uhs/atomizer/archiver/client.hpp.

Constructor & Destructor Documentation

◆ client() [1/2]

cbdc::archiver::client::client ( network::endpoint_t endpoint,
std::shared_ptr< logging::log > logger )

Constructor.

Parameters
endpointarchiver endpoint with which to connect.
loggerpointer to shared logger.

Definition at line 14 of file uhs/atomizer/archiver/client.cpp.

◆ client() [2/2]

cbdc::archiver::client::client ( )
delete

Member Function Documentation

◆ get_block()

auto cbdc::archiver::client::get_block ( uint64_t height) -> std::optional<cbdc::atomizer::block>

Retrieves the block at the given height from the archiver.

Parameters
heightheight of the block to retrieve.
Returns
block at the given height or std::nullopt if not found.

Definition at line 23 of file uhs/atomizer/archiver/client.cpp.

References cbdc::from_buffer().

Here is the call graph for this function:

◆ init()

auto cbdc::archiver::client::init ( ) -> bool

Attempts to connect to the archiver.

Returns
true if the connection was successful.

Definition at line 19 of file uhs/atomizer/archiver/client.cpp.


The documentation for this class was generated from the following files: