10#ifndef OPENCBDC_TX_SRC_WATCHTOWER_WATCHTOWER_H_
11#define OPENCBDC_TX_SRC_WATCHTOWER_WATCHTOWER_H_
59 [[nodiscard]]
auto height() const -> uint64_t;
77 = std::variant<status_update_request, best_block_height_request>;
135 watchtower(
size_t block_cache_size,
size_t error_cache_size);
146 void add_errors(std::vector<tx_error>&& errs);
164 -> std::unique_ptr<response>;
171 -> std::unique_ptr<response>;
175 std::shared_mutex m_bc_mut;
177 std::shared_mutex m_ec_mut;
179 auto check_uhs_id_statuses(
const std::vector<hash_t>& uhs_ids,
183 uint64_t best_height)
184 -> std::vector<status_update_state>;
Interface for serializing objects into and out of raw bytes representations.
Contains the watchtower's known best block height.
auto height() const -> uint64_t
Returns the states of a set of UHS IDs, following the order of the UHS IDs in the containing StatusUp...
best_block_height_response()=delete
auto operator==(const best_block_height_response &rhs) const -> bool
Stores a set of blocks in memory and maintains an index of the UHS IDs contained therein.
Stores a set of internal transaction errors in memory, indexed by Tx ID and UHS ID.
RPC request message to the watchtower external endpoint.
auto payload() const -> const request_t &
Return the request payload.
auto operator==(const request &rhs) const -> bool
std::variant< status_update_request, best_block_height_request > request_t
RPC response message from the watchtower external endpoint.
std::variant< status_request_check_success, best_block_height_response > response_t
Indicates a successful check request, sent with a StatusUpdateResponse.
Network request to interact with the Watchtower's status update service.
Service to answer client requests for processing status updates on submitted transactions.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
auto operator>>(serializer &deser, parsec::agent::rpc::request &req) -> serializer &
auto operator<<(serializer &ser, const parsec::agent::rpc::request &req) -> serializer &
Batch of compact transactions settled by the atomizer.
Request the watchtower's known best block height.
auto operator==(const best_block_height_request &) const -> bool
best_block_height_request()=default
Messages clients can use to communicate with the Watchtower.