diff options
Diffstat (limited to 'node/main.cpp')
| -rw-r--r-- | node/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/node/main.cpp b/node/main.cpp index acfdafe..02838f1 100644 --- a/node/main.cpp +++ b/node/main.cpp @@ -22,6 +22,7 @@ int main(int argc, char* argv[]) { ("next_node,n", po::value<std::string>(), "The address of the next node in the network.") ("first,f", "This is the first node and will be the communication point for the clients.") ("last,l", "this is the last node and will be able to send the original message out of the network.") + ("minimum_nr_messages,m", po::value<unsigned int>(), "minimum number of messages that needs to accumulate before starting a mix.") ("cert,c", po::value<std::string>(), "The cert file to use (in pem format).") ("key,k", po::value<std::string>(), "The key file (in pem format).") ("dhparam,d", po::value<std::string>(), "The dhparam file.") @@ -93,6 +94,15 @@ int main(int argc, char* argv[]) { BOOST_LOG_TRIVIAL(info) << "Started node"; bool is_first = bool(vm.count("first")); + unsigned int minimum_nr_messages = 0; + if(is_first) { + if(vm.count("minimum_nr_messages")) { + minimum_nr_messages = vm["minimum_nr_messages"].as<unsigned int>(); + } else { + std::cerr << "Minimum nr of messages is a required parameter for the first node" << std::endl; + return -1; + } + } bool is_last = bool(vm.count("last")); std::string next_node; if(vm.count("next_node")) { @@ -114,7 +124,7 @@ int main(int argc, char* argv[]) { Uri uri = parse_uri(next_node); - NodeNetworkSettings nsettings{is_first, is_last, uri.host, uri.port, certdir}; + NodeNetworkSettings nsettings{is_first, is_last, uri.host, uri.port, certdir, minimum_nr_messages}; Node node(lsettings, nsettings); node.run(); |
