#include "cmixclient.hpp" #include "uriparser.hpp" #include "logging.hpp" #include #include #include int main(int argc, char* argv[]) { namespace po = boost::program_options; init_logging(boost::log::trivial::severity_level::trace, "client"); BOOST_LOG_TRIVIAL(info) << "Started node"; po::options_description desc("Allowed options"); desc.add_options() ("help,h", "produce help message.") ("network,n", po::value>()->multitoken(), "The addresses of the network nodes in order") ; po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); po::notify(vm); if (vm.count("help")) { std::cout << desc << "\n"; return 0; } std::vector network; if(vm.count("network")) { network = vm["network"].as>(); } else { std::cerr << "network option is required." << std::endl; return -1; } std::vector node_details; for(auto&& node : network) { Uri uri = parse_uri(node); node_details.push_back({uri.host, uri.port}); } CMixClient cmix_client(node_details); cmix_client.run(); }