6#ifndef TX_STATUS_CLIENT_H_INC
7#define TX_STATUS_CLIENT_H_INC
30 shard_read_only_endpoints,
31 std::vector<config::shard_range_t> shard_ranges,
32 std::chrono::milliseconds timeout
33 = std::chrono::milliseconds::zero());
55 -> std::optional<bool>
override;
63 -> std::optional<bool>
override;
66 std::vector<std::unique_ptr<
69 std::vector<config::shard_range_t> m_shard_ranges;
70 std::chrono::milliseconds m_request_timeout;
73 auto make_request(
const hash_t& val) -> std::optional<bool> {
75 for(
size_t i = 0; i < m_shard_ranges.size(); i++) {
77 return m_shard_clients[i]->call(T{val}, m_request_timeout);
Client for interacting with the read-only port on 2PC shards.
auto init() -> bool
Initializes the client by creating a TCP RPC client for each shard cluster.
auto operator=(const status_client &) -> status_client &=delete
status_client(const status_client &)=delete
status_client(status_client &&)=delete
auto operator=(status_client &&) -> status_client &=delete
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 c...
~status_client() override=default
Destructor.
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.
Interface for querying the read-only state of a locking shard.
Implements an RPC client over TCP sockets.
Tools for reading options from a configuration file and building application-specific parameter sets ...
auto hash_in_shard_range(const shard_range_t &range, const hash_t &val) -> bool
Checks if a hash is in the given range handled.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.