OpenCBDC Transaction Processor
|
Client to asynchronously request information from the watchtower. More...
#include <client.hpp>
Public Types | |
using | status_update_response_handler_t |
using | best_block_height_handler_t |
Public Member Functions | |
async_client ()=delete | |
async_client (network::endpoint_t ep) | |
Constructor. | |
~async_client () | |
async_client (const async_client &)=delete | |
auto | operator= (const async_client &) -> async_client &=delete |
async_client (async_client &&)=delete | |
auto | operator= (async_client &&) -> async_client &=delete |
auto | init () -> bool |
Attempts to connect to the watchtower. | |
void | request_best_block_height () |
Sends a request_best_block_height to the Watchtower. | |
void | request_status_update (const status_update_request &req) |
Sends a StatusUpdateRequest to the Watchtower. | |
void | set_status_update_handler (const status_update_response_handler_t &handler) |
Sets or replaces the handler for asynchronously delivered StatusUpdateResponses. | |
void | set_block_height_handler (const best_block_height_handler_t &handler) |
Sets or replaces the handler for asynchronously delivered StatusUpdateResponses. | |
Client to asynchronously request information from the watchtower.
Definition at line 61 of file uhs/atomizer/watchtower/client.hpp.
Definition at line 94 of file uhs/atomizer/watchtower/client.hpp.
Definition at line 85 of file uhs/atomizer/watchtower/client.hpp.
|
delete |
|
explicit |
Constructor.
ep | Watchtower endpoint. |
Definition at line 73 of file uhs/atomizer/watchtower/client.cpp.
cbdc::watchtower::async_client::~async_client | ( | ) |
Definition at line 75 of file uhs/atomizer/watchtower/client.cpp.
References cbdc::network::connection_manager::close().
|
delete |
|
delete |
auto cbdc::watchtower::async_client::init | ( | ) | -> bool |
Attempts to connect to the watchtower.
Definition at line 85 of file uhs/atomizer/watchtower/client.cpp.
|
delete |
|
delete |
void cbdc::watchtower::async_client::request_best_block_height | ( | ) |
Sends a request_best_block_height to the Watchtower.
Definition at line 130 of file uhs/atomizer/watchtower/client.cpp.
References cbdc::network::connection_manager::broadcast(), and cbdc::make_shared_buffer().
void cbdc::watchtower::async_client::request_status_update | ( | const status_update_request & | req | ) |
Sends a StatusUpdateRequest to the Watchtower.
Definition at line 137 of file uhs/atomizer/watchtower/client.cpp.
References cbdc::network::connection_manager::broadcast(), and cbdc::make_shared_buffer().
void cbdc::watchtower::async_client::set_block_height_handler | ( | const best_block_height_handler_t & | handler | ) |
Sets or replaces the handler for asynchronously delivered StatusUpdateResponses.
handler | the handler function that the client should call whenever it receives a new StatusUpdateResponse. |
Definition at line 148 of file uhs/atomizer/watchtower/client.cpp.
void cbdc::watchtower::async_client::set_status_update_handler | ( | const status_update_response_handler_t & | handler | ) |
Sets or replaces the handler for asynchronously delivered StatusUpdateResponses.
handler | the handler function that the client should call whenever it receives a new StatusUpdateResponse. |
Definition at line 143 of file uhs/atomizer/watchtower/client.cpp.