OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::parsec Namespace Reference

Namespaces

namespace  agent
 
namespace  broker
 
namespace  directory
 
namespace  runtime_locking_shard
 
namespace  ticket_machine
 

Data Structures

struct  config
 Configuration parameters for a phase two system. More...
 

Enumerations

enum class  load_type { transfer , erc20 }
 Type of load to generate for benchmarking. More...
 
enum class  runner_type { lua , evm }
 Execution/transaction model. More...
 

Functions

auto split (const std::string &s, const std::string &delim) -> std::vector< std::string >
 
auto parse_args (int argc, char **argv) -> std::optional< std::unordered_map< std::string, std::string > >
 
auto read_endpoints (const std::unordered_map< std::string, std::string > &opts, const std::string &component_name) -> std::optional< std::vector< network::endpoint_t > >
 
auto read_cluster_endpoints (const std::unordered_map< std::string, std::string > &opts, const std::string &component_name) -> std::optional< std::vector< std::vector< network::endpoint_t > > >
 
auto read_config (int argc, char **argv) -> std::optional< config >
 Reads the configuration parameters from the program arguments.
 
auto put_row (const std::shared_ptr< broker::interface > &broker, broker::key_type key, broker::value_type value, const std::function< void(bool)> &result_callback) -> bool
 Asynchronously inserts the given row into the cluster.
 
auto get_row (const std::shared_ptr< broker::interface > &broker, broker::key_type key, const std::function< void( cbdc::parsec::broker::interface::try_lock_return_type)> &result_callback) -> cbdc::parsec::broker::interface::try_lock_return_type
 Asynchronously get the value stored at key from the cluster.
 

Enumeration Type Documentation

◆ load_type

enum class cbdc::parsec::load_type
strong

Type of load to generate for benchmarking.

Enumerator
transfer 

Base token transfer.

erc20 

ERC20 token transfer.

Definition at line 15 of file parsec/util.hpp.

◆ runner_type

enum class cbdc::parsec::runner_type
strong

Execution/transaction model.

Enumerator
lua 

Transaction semantics defined using Lua.

evm 

Ethereum-style transactions using EVM.

Definition at line 23 of file parsec/util.hpp.

Function Documentation

◆ get_row()

auto cbdc::parsec::get_row ( const std::shared_ptr< broker::interface > & broker,
broker::key_type key,
const std::function< void(cbdc::parsec::broker::interface::try_lock_return_type)> & result_callback ) -> cbdc::parsec::broker::interface::try_lock_return_type

Asynchronously get the value stored at key from the cluster.

Intended for testing and administrative purposes.

Parameters
brokerbroker to use for reading the row.
keykey at which to read.
result_callbackfunction to call on fetch success or failure.
Returns
value stored at key

Definition at line 250 of file util.cpp.

References cbdc::parsec::runtime_locking_shard::read.

◆ parse_args()

auto cbdc::parsec::parse_args ( int argc,
char ** argv ) -> std::optional<std::unordered_map<std::string, std::string>>

Definition at line 28 of file util.cpp.

References cbdc::config::get_args(), and split().

Referenced by read_config().

Here is the call graph for this function:

◆ put_row()

auto cbdc::parsec::put_row ( const std::shared_ptr< broker::interface > & broker,
broker::key_type key,
broker::value_type value,
const std::function< void(bool)> & result_callback ) -> bool

Asynchronously inserts the given row into the cluster.

Parameters
brokerbroker to use for inserting the row.
keykey at which to insert value.
valuevalue to insert at given key.
result_callbackfunction to call on insertion success or failure.
Returns
true if request was initiated successfully.

Definition at line 195 of file util.cpp.

References cbdc::parsec::runtime_locking_shard::write.

Referenced by cbdc::parsec::agent::runner::mint_initial_accounts().

◆ read_cluster_endpoints()

auto cbdc::parsec::read_cluster_endpoints ( const std::unordered_map< std::string, std::string > & opts,
const std::string & component_name ) -> std::optional<std::vector<std::vector<network::endpoint_t>>>

Definition at line 75 of file util.cpp.

References read_endpoints().

Referenced by read_config().

Here is the call graph for this function:

◆ read_config()

auto cbdc::parsec::read_config ( int argc,
char ** argv ) -> std::optional< config >

Reads the configuration parameters from the program arguments.

Parameters
argcnumber of program arguments.
argvprogram arguments.
Returns
configuration parametrs or std::nullopt if there was an error while parsing the arguments.

Definition at line 100 of file util.cpp.

References erc20, evm, lua, cbdc::parsec::config::m_component_id, parse_args(), cbdc::logging::parse_loglevel(), read_cluster_endpoints(), read_endpoints(), cbdc::logging::trace, and transfer.

Referenced by main().

Here is the call graph for this function:

◆ read_endpoints()

auto cbdc::parsec::read_endpoints ( const std::unordered_map< std::string, std::string > & opts,
const std::string & component_name ) -> std::optional<std::vector<network::endpoint_t>>

Definition at line 50 of file util.cpp.

References cbdc::config::parse_ip_port().

Referenced by read_cluster_endpoints(), and read_config().

Here is the call graph for this function:

◆ split()

auto cbdc::parsec::split ( const std::string & s,
const std::string & delim ) -> std::vector<std::string>

Definition at line 12 of file util.cpp.

Referenced by parse_args().