OpenCBDC Transaction Processor
|
Client for interacting with the read-only port on 2PC shards. More...
#include <status_client.hpp>
Public Member Functions | |
status_client (std::vector< std::vector< network::endpoint_t > > shard_read_only_endpoints, std::vector< config::shard_range_t > shard_ranges, std::chrono::milliseconds timeout=std::chrono::milliseconds::zero()) | |
Constructor. | |
~status_client () override=default | |
Destructor. | |
status_client ()=delete | |
status_client (const status_client &)=delete | |
auto | operator= (const status_client &) -> status_client &=delete |
status_client (status_client &&)=delete | |
auto | operator= (status_client &&) -> status_client &=delete |
auto | init () -> bool |
Initializes the client by creating a TCP RPC client for each shard cluster. | |
auto | check_unspent (const hash_t &uhs_id) -> std::optional< bool > override |
Queries the shard cluster responsible for the given UHS ID for whether it is unspent. | |
auto | check_tx_id (const hash_t &tx_id) -> std::optional< bool > override |
Queries the shard cluster responsible for the given TX ID for whether it is in the confirmed TX IDs cache. | |
![]() | |
status_interface ()=default | |
virtual | ~status_interface ()=default |
status_interface (const status_interface &)=default | |
auto | operator= (const status_interface &) -> status_interface &=default |
status_interface (status_interface &&)=default | |
auto | operator= (status_interface &&) -> status_interface &=default |
Client for interacting with the read-only port on 2PC shards.
Allows for checking whether a TX ID has been confirmed or whether a UHS ID is currently unspent. Connects to all shard nodes to handle failover and routes requests to the relevant shard.
Definition at line 19 of file status_client.hpp.
cbdc::locking_shard::rpc::status_client::status_client | ( | std::vector< std::vector< network::endpoint_t > > | shard_read_only_endpoints, |
std::vector< config::shard_range_t > | shard_ranges, | ||
std::chrono::milliseconds | timeout = std::chrono::milliseconds::zero() ) |
Constructor.
shard_read_only_endpoints | list of endpoints by shard ID then node ID. |
shard_ranges | list of shard hash prefix ranges by shard ID. Must be the same size as shard_read_only_endpoints. |
timeout | optional timeout for status requests. Zero indicates no timeout. |
Definition at line 11 of file status_client.cpp.
|
overridedefault |
Destructor.
|
delete |
|
delete |
|
delete |
|
nodiscardoverridevirtual |
Queries the shard cluster responsible for the given TX ID for whether it is in the confirmed TX IDs cache.
tx_id | TX ID to query. |
Implements cbdc::locking_shard::status_interface.
Definition at line 37 of file status_client.cpp.
|
nodiscardoverridevirtual |
Queries the shard cluster responsible for the given UHS ID for whether it is unspent.
uhs_id | UHS ID to query. |
Implements cbdc::locking_shard::status_interface.
Definition at line 42 of file status_client.cpp.
auto cbdc::locking_shard::rpc::status_client::init | ( | ) | -> bool |
Initializes the client by creating a TCP RPC client for each shard cluster.
Definition at line 28 of file status_client.cpp.
References cbdc::locking_shard::rpc::client::init().
|
delete |
|
delete |