OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
uhs/twophase/coordinator/client.cpp
Go to the documentation of this file.
1// Copyright (c) 2021 MIT Digital Currency Initiative,
2// Federal Reserve Bank of Boston
3// Distributed under the MIT software license, see the accompanying
4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6#include "client.hpp"
7
9
11 client::client(std::vector<network::endpoint_t> endpoints)
12 : m_client(std::make_unique<decltype(m_client)::element_type>(
13 std::move(endpoints))) {}
14
15 auto client::init() -> bool {
16 return m_client->init();
17 }
18
20 callback_type result_callback) -> bool {
21 return m_client->call(std::move(tx), std::move(result_callback));
22 }
23}
std::function< void(std::optional< bool >)> callback_type
Signature of callback function for a transaction execution result.
auto init() -> bool
Initializes the RPC client by connecting to the coordinator cluster and starting a response handler t...
auto execute_transaction(transaction::compact_tx tx, callback_type result_callback) -> bool override
Requests execution of the given transaction using the coordinator cluster.
A condensed, hash-only transaction representation.