6#ifndef OPENCBDC_TX_SRC_ATOMIZER_ATOMIZER_RAFT_H_
7#define OPENCBDC_TX_SRC_ATOMIZER_ATOMIZER_RAFT_H_
31 std::vector<network::endpoint_t> raft_endpoints,
32 size_t stxo_cache_depth,
33 std::shared_ptr<logging::log> logger,
35 nuraft::cb_func::func_type raft_callback);
73 static constexpr const auto m_node_type =
"atomizer";
75 using attestation = std::pair<uint64_t, uint64_t>;
77 struct attestation_hash {
78 auto operator()(
const attestation& pair)
const -> size_t;
81 struct attestation_cmp {
82 auto operator()(
const attestation& a,
const attestation& b)
const
86 using attestation_set = std::
87 unordered_set<attestation, attestation_hash, attestation_cmp>;
93 std::mutex m_complete_mut;
94 std::vector<aggregate_tx_notification> m_complete_txs;
95 std::shared_ptr<logging::log> m_log;
Manager for an atomizer raft node.
void tx_notify(tx_notify_request &¬if)
Add the given transaction notification to the set of pending notifications.
auto send_complete_txs(const raft::callback_type &result_fn) -> bool
Replicate a transaction notification command in the state machine containing the current set of compl...
auto get_sm() -> state_machine *
Return a pointer to the state machine replicated by this raft node.
atomizer_raft(uint32_t atomizer_id, std::vector< network::endpoint_t > raft_endpoints, size_t stxo_cache_depth, std::shared_ptr< logging::log > logger, config::options opts, nuraft::cb_func::func_type raft_callback)
Constructor.
auto make_request(const state_machine::request &r, const raft::callback_type &result_fn) -> bool
Serialize and replicate the given request in the atomizer raft cluster.
auto tx_notify_count() -> uint64_t
Return the number of transaction notifications handled by the state machine.
Raft state machine for managing a replicated atomizer.
std::variant< aggregate_tx_notify_request, make_block_request, get_block_request, prune_request > request
Atomizer state machine request.
A node in a raft cluster.
std::function< void(result_type &r, nuraft::ptr< std::exception > &err)> callback_type
Function type for raft state machine execution result callbacks.
Transaction notification message.
Project-wide configuration options.
A condensed, hash-only transaction representation.