6#ifndef OPENCBDC_TX_SRC_CLIENT_TWOPHASE_CLIENT_H_
7#define OPENCBDC_TX_SRC_CLIENT_TWOPHASE_CLIENT_H_
25 const std::shared_ptr<logging::log>& logger,
26 const std::string& wallet_file,
27 const std::string& client_file);
44 auto sync() ->
bool override;
82 std::shared_ptr<logging::log> m_logger;
86 decltype(&secp256k1_context_destroy)>
87 m_secp{secp256k1_context_create(SECP256K1_CONTEXT_SIGN),
88 &secp256k1_context_destroy};
90 static constexpr auto m_client_timeout
91 = std::chrono::milliseconds(5000);
External client for sending new transactions to the system.
RPC client for a coordinator.
Client for interacting with the read-only port on 2PC shards.
Client for interacting with the 2PC architecture.
auto check_unspent(const hash_t &uhs_id) -> std::optional< bool >
Checks the shard network for the status of a specific UHS ID.
twophase_client(twophase_client &&)=delete
auto sync() -> bool override
Update the client with the latest state from the shard network.
auto send_mint_tx(const transaction::full_tx &mint_tx) -> bool override
Sends the given mint transaction directly to a coordinator cluster.
auto operator=(twophase_client &&) -> twophase_client &=delete
auto check_tx_id(const hash_t &tx_id) -> std::optional< bool >
Checks the shard network for the status of a specific transaction.
auto init_derived() -> bool override
Initializes the 2PC architecture client.
~twophase_client() override=default
auto operator=(const twophase_client &) -> twophase_client &=delete
twophase_client(const twophase_client &)=delete
struct secp256k1_context_struct secp256k1_context
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
Project-wide configuration options.