#pragma once #include "server.hpp" #include "nodeclient.hpp" #include "nextnode.hpp" #include "api.h" #include "curve25519.h" #include "cmix.pb.h" #include #include struct NodeNetworkSettings { bool is_first; std::string next_host; std::string next_port; }; class Node { boost::asio::io_service io_service; Server server; std::list clients; NodeNetworkSettings network_settings; NextNode next_node; Api api; KeyPair keypair; std::vector network_pub_key; void accept_handler(boost::asio::ip::tcp::socket&& socket); void start_precomputation(); void start_initialisation(); public: Node(ListenSettings const& listen_settings, NodeNetworkSettings network_settings); ~Node(); void run() { io_service.run(); } };