OpenCBDC Transaction Processor
|
Namespaces | |
namespace | defaults |
Data Structures | |
struct | options |
Project-wide configuration options. More... | |
class | parser |
Reads configuration parameters line-by-line from a file. More... | |
Typedefs | |
using | shard_range_t = std::pair<uint8_t, uint8_t> |
[start, end] inclusive. | |
Functions | |
auto | parse_ip_port (const std::string &in_str) -> network::endpoint_t |
void | get_shard_key_prefix (std::stringstream &ss, size_t shard_id) |
auto | get_shard_endpoint_key (size_t shard_id) -> std::string |
auto | get_atomizer_endpoint_key (size_t atomizer_id) -> std::string |
auto | get_atomizer_raft_endpoint_key (size_t atomizer_id) -> std::string |
auto | get_atomizer_loglevel_key (size_t atomizer_id) -> std::string |
auto | get_sentinel_endpoint_key (size_t sentinel_id) -> std::string |
auto | get_shard_db_key (size_t shard_id) -> std::string |
auto | get_shard_end_key (size_t shard_id) -> std::string |
auto | get_shard_start_key (size_t shard_id) -> std::string |
void | get_archiver_key_prefix (std::stringstream &ss, size_t archiver_id) |
auto | get_archiver_endpoint_key (size_t archiver_id) -> std::string |
auto | get_archiver_loglevel_key (size_t archiver_id) -> std::string |
auto | get_archiver_db_key (size_t archiver_id) -> std::string |
auto | get_shard_loglevel_key (size_t shard_id) -> std::string |
void | get_sentinel_key_prefix (std::stringstream &ss, size_t sentinel_id) |
auto | get_sentinel_loglevel_key (size_t sentinel_id) -> std::string |
void | get_watchtower_key_prefix (std::stringstream &ss, size_t watchtower_id) |
auto | get_watchtower_client_endpoint_key (size_t watchtower_id) -> std::string |
auto | get_watchtower_internal_endpoint_key (size_t watchtower_id) -> std::string |
auto | get_watchtower_loglevel_key (size_t watchtower_id) -> std::string |
auto | get_shard_node_count_key (size_t shard_id) -> std::string |
auto | get_shard_raft_endpoint_key (size_t shard_id, size_t node_id) -> std::string |
auto | get_shard_endpoint_key (size_t shard_id, size_t node_id) -> std::string |
auto | get_shard_readonly_endpoint_key (size_t shard_id, size_t node_id) -> std::string |
void | get_coordinator_key_prefix (std::stringstream &ss, size_t coordinator_id) |
auto | get_coordinator_endpoint_key (size_t coordinator_id, size_t node_id) -> std::string |
auto | get_coordinator_raft_endpoint_key (size_t coordinator_id, size_t node_id) -> std::string |
auto | get_coordinator_node_count_key (size_t coordinator_id) -> std::string |
auto | get_coordinator_loglevel_key (size_t coordinator_id) -> std::string |
auto | get_sentinel_private_key_key (size_t sentinel_id) -> std::string |
auto | get_sentinel_public_key_key (size_t sentinel_id) -> std::string |
auto | read_shard_endpoints (options &opts, const parser &cfg) -> std::optional< std::string > |
auto | read_shard_options (options &opts, const parser &cfg) -> std::optional< std::string > |
auto | read_coordinator_options (options &opts, const parser &cfg) -> std::optional< std::string > |
auto | read_sentinel_options (options &opts, const parser &cfg) -> std::optional< std::string > |
auto | read_atomizer_options (options &opts, const parser &cfg) -> std::optional< std::string > |
auto | read_archiver_options (options &opts, const parser &cfg) -> std::optional< std::string > |
auto | read_watchtower_options (options &opts, const parser &cfg) -> std::optional< std::string > |
void | read_raft_options (options &opts, const parser &cfg) |
void | read_loadgen_options (options &opts, const parser &cfg) |
auto | read_options (const std::string &config_file) -> std::variant< options, std::string > |
Read options from the given config file without checking invariants. | |
auto | load_options (const std::string &config_file) -> std::variant< options, std::string > |
Loads options from the given config file and check for invariants. | |
auto | check_options (const options &opts) -> std::optional< std::string > |
Checks a fully populated options struct for invariants. | |
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. | |
auto | loadgen_seed_range (const options &opts, size_t gen_id) -> std::pair< size_t, size_t > |
Calculates the sub-range of total seeded outputs for a particular load generator ID. | |
auto | get_args (int argc, char **argv) -> std::vector< std::string > |
Converts c-args from an executable's main function into a vector of strings. | |
using cbdc::config::shard_range_t = std::pair<uint8_t, uint8_t> |
[start, end] inclusive.
Definition at line 129 of file config.hpp.
auto cbdc::config::check_options | ( | const options & | opts | ) | -> std::optional< std::string > |
Checks a fully populated options struct for invariants.
Assumes struct contains all required options.
opts | options struct to check. |
Definition at line 680 of file config.cpp.
Referenced by load_options().
auto cbdc::config::get_archiver_db_key | ( | size_t | archiver_id | ) | -> std::string |
Definition at line 110 of file config.cpp.
References get_archiver_key_prefix().
Referenced by read_archiver_options().
auto cbdc::config::get_archiver_endpoint_key | ( | size_t | archiver_id | ) | -> std::string |
Definition at line 96 of file config.cpp.
References get_archiver_key_prefix().
Referenced by read_archiver_options().
void cbdc::config::get_archiver_key_prefix | ( | std::stringstream & | ss, |
size_t | archiver_id ) |
Definition at line 92 of file config.cpp.
Referenced by get_archiver_db_key(), get_archiver_endpoint_key(), and get_archiver_loglevel_key().
auto cbdc::config::get_archiver_loglevel_key | ( | size_t | archiver_id | ) | -> std::string |
Definition at line 103 of file config.cpp.
References get_archiver_key_prefix().
Referenced by read_archiver_options().
auto cbdc::config::get_args | ( | int | argc, |
char ** | argv ) -> std::vector< std::string > |
Converts c-args from an executable's main function into a vector of strings.
Definition at line 751 of file config.cpp.
Referenced by main(), and cbdc::parsec::parse_args().
auto cbdc::config::get_atomizer_endpoint_key | ( | size_t | atomizer_id | ) | -> std::string |
Definition at line 43 of file config.cpp.
Referenced by read_atomizer_options().
auto cbdc::config::get_atomizer_loglevel_key | ( | size_t | atomizer_id | ) | -> std::string |
Definition at line 57 of file config.cpp.
Referenced by read_atomizer_options().
auto cbdc::config::get_atomizer_raft_endpoint_key | ( | size_t | atomizer_id | ) | -> std::string |
Definition at line 50 of file config.cpp.
Referenced by read_atomizer_options().
auto cbdc::config::get_coordinator_endpoint_key | ( | size_t | coordinator_id, |
size_t | node_id ) -> std::string |
Definition at line 200 of file config.cpp.
References get_coordinator_key_prefix().
Referenced by read_coordinator_options().
void cbdc::config::get_coordinator_key_prefix | ( | std::stringstream & | ss, |
size_t | coordinator_id ) |
Definition at line 195 of file config.cpp.
Referenced by get_coordinator_endpoint_key(), get_coordinator_node_count_key(), and get_coordinator_raft_endpoint_key().
auto cbdc::config::get_coordinator_loglevel_key | ( | size_t | coordinator_id | ) | -> std::string |
Definition at line 223 of file config.cpp.
Referenced by read_coordinator_options().
auto cbdc::config::get_coordinator_node_count_key | ( | size_t | coordinator_id | ) | -> std::string |
Definition at line 216 of file config.cpp.
References get_coordinator_key_prefix().
Referenced by read_coordinator_options().
auto cbdc::config::get_coordinator_raft_endpoint_key | ( | size_t | coordinator_id, |
size_t | node_id ) -> std::string |
Definition at line 208 of file config.cpp.
References get_coordinator_key_prefix().
Referenced by read_coordinator_options().
auto cbdc::config::get_sentinel_endpoint_key | ( | size_t | sentinel_id | ) | -> std::string |
Definition at line 64 of file config.cpp.
Referenced by read_sentinel_options().
void cbdc::config::get_sentinel_key_prefix | ( | std::stringstream & | ss, |
size_t | sentinel_id ) |
Definition at line 124 of file config.cpp.
Referenced by get_sentinel_loglevel_key(), get_sentinel_private_key_key(), and get_sentinel_public_key_key().
auto cbdc::config::get_sentinel_loglevel_key | ( | size_t | sentinel_id | ) | -> std::string |
Definition at line 128 of file config.cpp.
References get_sentinel_key_prefix().
Referenced by read_sentinel_options().
auto cbdc::config::get_sentinel_private_key_key | ( | size_t | sentinel_id | ) | -> std::string |
Definition at line 230 of file config.cpp.
References get_sentinel_key_prefix().
Referenced by read_sentinel_options().
auto cbdc::config::get_sentinel_public_key_key | ( | size_t | sentinel_id | ) | -> std::string |
Definition at line 237 of file config.cpp.
References get_sentinel_key_prefix().
Referenced by read_sentinel_options().
auto cbdc::config::get_shard_db_key | ( | size_t | shard_id | ) | -> std::string |
Definition at line 71 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_options().
auto cbdc::config::get_shard_end_key | ( | size_t | shard_id | ) | -> std::string |
Definition at line 78 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_options().
auto cbdc::config::get_shard_endpoint_key | ( | size_t | shard_id | ) | -> std::string |
Definition at line 36 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_endpoints(), and read_shard_options().
auto cbdc::config::get_shard_endpoint_key | ( | size_t | shard_id, |
size_t | node_id ) -> std::string |
Definition at line 178 of file config.cpp.
References get_shard_key_prefix().
void cbdc::config::get_shard_key_prefix | ( | std::stringstream & | ss, |
size_t | shard_id ) |
Definition at line 32 of file config.cpp.
Referenced by get_shard_db_key(), get_shard_end_key(), get_shard_endpoint_key(), get_shard_endpoint_key(), get_shard_loglevel_key(), get_shard_node_count_key(), get_shard_raft_endpoint_key(), get_shard_readonly_endpoint_key(), and get_shard_start_key().
auto cbdc::config::get_shard_loglevel_key | ( | size_t | shard_id | ) | -> std::string |
Definition at line 117 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_options().
auto cbdc::config::get_shard_node_count_key | ( | size_t | shard_id | ) | -> std::string |
Definition at line 163 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_endpoints().
auto cbdc::config::get_shard_raft_endpoint_key | ( | size_t | shard_id, |
size_t | node_id ) -> std::string |
Definition at line 170 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_endpoints().
auto cbdc::config::get_shard_readonly_endpoint_key | ( | size_t | shard_id, |
size_t | node_id ) -> std::string |
Definition at line 186 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_endpoints().
auto cbdc::config::get_shard_start_key | ( | size_t | shard_id | ) | -> std::string |
Definition at line 85 of file config.cpp.
References get_shard_key_prefix().
Referenced by read_shard_options().
auto cbdc::config::get_watchtower_client_endpoint_key | ( | size_t | watchtower_id | ) | -> std::string |
Definition at line 140 of file config.cpp.
References get_watchtower_key_prefix().
Referenced by read_watchtower_options().
auto cbdc::config::get_watchtower_internal_endpoint_key | ( | size_t | watchtower_id | ) | -> std::string |
Definition at line 148 of file config.cpp.
References get_watchtower_key_prefix().
Referenced by read_watchtower_options().
void cbdc::config::get_watchtower_key_prefix | ( | std::stringstream & | ss, |
size_t | watchtower_id ) |
Definition at line 135 of file config.cpp.
Referenced by get_watchtower_client_endpoint_key(), get_watchtower_internal_endpoint_key(), and get_watchtower_loglevel_key().
auto cbdc::config::get_watchtower_loglevel_key | ( | size_t | watchtower_id | ) | -> std::string |
Definition at line 156 of file config.cpp.
References get_watchtower_key_prefix().
Referenced by read_watchtower_options().
auto cbdc::config::hash_in_shard_range | ( | const shard_range_t & | range, |
const hash_t & | val ) -> bool |
Checks if a hash is in the given range handled.
range | shard hash prefix range. |
val | hash to check. |
Definition at line 736 of file config.cpp.
Referenced by cbdc::locking_shard::interface::hash_in_shard_range(), and cbdc::locking_shard::rpc::status_client::operator=().
auto cbdc::config::load_options | ( | const std::string & | config_file | ) | -> std::variant< options, std::string > |
Loads options from the given config file and check for invariants.
config_file | the path to the config file from which load options. |
Definition at line 668 of file config.cpp.
References check_options(), and read_options().
Referenced by main().
auto cbdc::config::loadgen_seed_range | ( | const options & | opts, |
size_t | gen_id ) -> std::pair< size_t, size_t > |
Calculates the sub-range of total seeded outputs for a particular load generator ID.
opts | options struct from which to read seed data. |
gen_id | ID of load generator for which to calculate the sub-range. Must be less than the load generator count. |
Definition at line 741 of file config.cpp.
auto cbdc::config::parse_ip_port | ( | const std::string & | in_str | ) | -> network::endpoint_t |
Definition at line 13 of file config.cpp.
Referenced by cbdc::config::parser::get_endpoint(), and cbdc::parsec::read_endpoints().
auto cbdc::config::read_archiver_options | ( | options & | opts, |
const parser & | cfg ) -> std::optional<std::string> |
Definition at line 498 of file config.cpp.
References get_archiver_db_key(), get_archiver_endpoint_key(), and get_archiver_loglevel_key().
Referenced by read_options().
auto cbdc::config::read_atomizer_options | ( | options & | opts, |
const parser & | cfg ) -> std::optional<std::string> |
Definition at line 459 of file config.cpp.
References get_atomizer_endpoint_key(), get_atomizer_loglevel_key(), and get_atomizer_raft_endpoint_key().
Referenced by read_options().
auto cbdc::config::read_coordinator_options | ( | options & | opts, |
const parser & | cfg ) -> std::optional<std::string> |
Definition at line 362 of file config.cpp.
References get_coordinator_endpoint_key(), get_coordinator_loglevel_key(), get_coordinator_node_count_key(), and get_coordinator_raft_endpoint_key().
Referenced by read_options().
Definition at line 596 of file config.cpp.
References cbdc::config::parser::get_decimal(), cbdc::config::parser::get_ulong(), cbdc::config::options::m_fixed_tx_mode, cbdc::config::options::m_fixed_tx_rate, cbdc::config::options::m_initial_mint_count, cbdc::config::options::m_initial_mint_value, cbdc::config::options::m_input_count, cbdc::config::options::m_invalid_rate, cbdc::config::options::m_loadgen_count, cbdc::config::options::m_output_count, and cbdc::config::options::m_window_size.
Referenced by read_options().
auto cbdc::config::read_options | ( | const std::string & | config_file | ) | -> std::variant< options, std::string > |
Read options from the given config file without checking invariants.
config_file | the path to the config file from which to load options. |
Definition at line 619 of file config.cpp.
References read_archiver_options(), read_atomizer_options(), read_coordinator_options(), read_loadgen_options(), read_raft_options(), read_sentinel_options(), read_shard_endpoints(), read_shard_options(), and read_watchtower_options().
Referenced by load_options().
Definition at line 576 of file config.cpp.
References cbdc::config::parser::get_ulong(), cbdc::config::options::m_batch_size, cbdc::config::options::m_election_timeout_lower, cbdc::config::options::m_election_timeout_upper, cbdc::config::options::m_heartbeat, cbdc::config::options::m_raft_max_batch, and cbdc::config::options::m_snapshot_distance.
Referenced by read_options().
auto cbdc::config::read_sentinel_options | ( | options & | opts, |
const parser & | cfg ) -> std::optional<std::string> |
Definition at line 409 of file config.cpp.
References get_sentinel_endpoint_key(), get_sentinel_loglevel_key(), get_sentinel_private_key_key(), get_sentinel_public_key_key(), and cbdc::hash_from_hex().
Referenced by read_options().
auto cbdc::config::read_shard_endpoints | ( | options & | opts, |
const parser & | cfg ) -> std::optional<std::string> |
Definition at line 244 of file config.cpp.
References get_shard_endpoint_key(), get_shard_node_count_key(), get_shard_raft_endpoint_key(), and get_shard_readonly_endpoint_key().
Referenced by read_options().
auto cbdc::config::read_shard_options | ( | options & | opts, |
const parser & | cfg ) -> std::optional<std::string> |
Definition at line 295 of file config.cpp.
References get_shard_db_key(), get_shard_end_key(), get_shard_endpoint_key(), get_shard_loglevel_key(), get_shard_start_key(), and cbdc::hash_from_hex().
Referenced by read_options().
auto cbdc::config::read_watchtower_options | ( | options & | opts, |
const parser & | cfg ) -> std::optional<std::string> |
Definition at line 529 of file config.cpp.
References get_watchtower_client_endpoint_key(), get_watchtower_internal_endpoint_key(), and get_watchtower_loglevel_key().
Referenced by read_options().