From e5e352bbc345fb02a4a9c5870e2743e6789b0df3 Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Thu, 12 Jan 2023 22:36:30 +0000 Subject: [PATCH 1/4] Remove nano-pow-server from git and cmake files Remove nano-pw-server from git repo and from cmake files. --- .gitmodules | 3 --- CMakeLists.txt | 22 ---------------------- nano-pow-server | 1 - 3 files changed, 26 deletions(-) delete mode 160000 nano-pow-server diff --git a/.gitmodules b/.gitmodules index 7495827956..900d962a80 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,9 +17,6 @@ [submodule "cpptoml"] path = cpptoml url = https://github.com/cryptocode/cpptoml.git -[submodule "nano-pow-server"] - path = nano-pow-server - url = https://github.com/nanocurrency/nano-pow-server.git [submodule "flatbuffers"] path = flatbuffers url = https://github.com/google/flatbuffers.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ca867cd5c..5e15e0c293 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,9 +83,6 @@ set(NANO_TEST set(NANO_SECURE_RPC OFF CACHE BOOL "") -set(NANO_POW_SERVER - OFF - CACHE BOOL "") set(NANO_WARN_TO_ERR OFF CACHE BOOL "") @@ -571,9 +568,6 @@ add_library(blake2 crypto/blake2/blake2-config.h crypto/blake2/blake2-impl.h target_compile_definitions(blake2 PRIVATE -D__SSE2__) -if(NANO_POW_SERVER) - add_subdirectory(nano-pow-server) -endif() add_subdirectory(nano/crypto_lib) add_subdirectory(nano/secure) add_subdirectory(nano/lib) @@ -772,12 +766,6 @@ if(NANO_GUI OR RAIBLOCKS_GUI) endif() endforeach(boost_lib) endif() - if(NANO_POW_SERVER) - install(TARGETS nano_pow_server - DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/MacOS) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public - DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/MacOS) - endif() install(FILES Nano.icns DESTINATION ${NANO_OSX_PACKAGE_NAME}.app/Contents/Resources) elseif(WIN32) @@ -825,11 +813,6 @@ if(NANO_GUI OR RAIBLOCKS_GUI) endif() endforeach(boost_lib) endif() - if(NANO_POW_SERVER) - install(TARGETS nano_pow_server DESTINATION .) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public - DESTINATION .) - endif() install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${WIN_REDIST} DESTINATION .) install(FILES ${Qt5_bin_DIR}/libGLESv2.dll DESTINATION .) install(FILES ${Qt5_bin_DIR}/Qt5Core.dll DESTINATION .) @@ -852,11 +835,6 @@ if(NANO_GUI OR RAIBLOCKS_GUI) endif() endforeach(boost_lib) endif() - if(NANO_POW_SERVER) - install(TARGETS nano_pow_server DESTINATION ./bin) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public - DESTINATION ./bin) - endif() set(DEBIAN_POSTINST postinst.in) set(DEBIAN_POSTRM postrm.in) diff --git a/nano-pow-server b/nano-pow-server deleted file mode 160000 index 00591aeae9..0000000000 --- a/nano-pow-server +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 00591aeae94bc52d2f087bcb1bf255396f59b42f From 9adaff8ba7cb5e1fa8449ff57a6740edc7bad52d Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Thu, 12 Jan 2023 22:52:06 +0000 Subject: [PATCH 2/4] Remove commented out code that used to spawn nano-pow-server We are rmeoving nano-pow-server so it is not relevant anymore. --- nano/nano_node/daemon.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/nano/nano_node/daemon.cpp b/nano/nano_node/daemon.cpp index 700b5a7753..37c06a1461 100644 --- a/nano/nano_node/daemon.cpp +++ b/nano/nano_node/daemon.cpp @@ -159,19 +159,6 @@ void nano_daemon::daemon::run (boost::filesystem::path const & data_path, nano:: node->start (); nano::ipc::ipc_server ipc_server (*node, config.rpc); std::unique_ptr rpc_process; - std::unique_ptr nano_pow_server_process; - - /*if (config.pow_server.enable) - { - if (!boost::filesystem::exists (config.pow_server.pow_server_path)) - { - std::cerr << std::string ("nano_pow_server is configured to start as a child process, however the file cannot be found at: ") + config.pow_server.pow_server_path << std::endl; - std::exit (1); - } - - nano_pow_server_process = std::make_unique (config.pow_server.pow_server_path, "--config_path", data_path / "config-nano-pow-server.toml"); - }*/ - std::unique_ptr rpc; std::unique_ptr rpc_handler; if (config.rpc_enable) From cf1498dcc861e9a975c9711d71a2a118f44391b2 Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Thu, 12 Jan 2023 23:12:15 +0000 Subject: [PATCH 3/4] Remove any references to nano-pow-server The nano node and the nano wallet used to have options to spawn nano-pow-server. And there were config settings for nano-pow-server for enabling and settings paths. --- nano/nano_wallet/entry.cpp | 18 ------------- nano/node/CMakeLists.txt | 2 -- nano/node/daemonconfig.cpp | 11 -------- nano/node/daemonconfig.hpp | 2 -- nano/node/node_pow_server_config.cpp | 17 ------------- nano/node/node_pow_server_config.hpp | 38 ---------------------------- 6 files changed, 88 deletions(-) delete mode 100644 nano/node/node_pow_server_config.cpp delete mode 100644 nano/node/node_pow_server_config.hpp diff --git a/nano/nano_wallet/entry.cpp b/nano/nano_wallet/entry.cpp index 10b3bf1080..39681540c5 100644 --- a/nano/nano_wallet/entry.cpp +++ b/nano/nano_wallet/entry.cpp @@ -163,19 +163,6 @@ int run_wallet (QApplication & application, int argc, char * const * argv, boost nano::ipc::ipc_server ipc (*node, config.rpc); std::unique_ptr rpc_process; - std::unique_ptr nano_pow_server_process; - - if (config.pow_server.enable) - { - if (!boost::filesystem::exists (config.pow_server.pow_server_path)) - { - splash->hide (); - show_error (std::string ("nano_pow_server is configured to start as a child process, however the file cannot be found at: ") + config.pow_server.pow_server_path); - std::exit (1); - } - - nano_pow_server_process = std::make_unique (config.pow_server.pow_server_path, "--config_path", data_path / "config-nano-pow-server.toml"); - } std::unique_ptr rpc; std::unique_ptr rpc_handler; if (config.rpc_enable) @@ -220,11 +207,6 @@ int run_wallet (QApplication & application, int argc, char * const * argv, boost { rpc_process->terminate (); } - - if (nano_pow_server_process) - { - nano_pow_server_process->terminate (); - } #endif runner.stop_event_processing (); }); diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index 4202a0acc0..fee6451b8c 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -147,8 +147,6 @@ add_library( portmapping.cpp prioritization.cpp prioritization.hpp - node_pow_server_config.hpp - node_pow_server_config.cpp repcrawler.hpp repcrawler.cpp request_aggregator.hpp diff --git a/nano/node/daemonconfig.cpp b/nano/node/daemonconfig.cpp index 049383d1bb..b7df1ebf2f 100644 --- a/nano/node/daemonconfig.cpp +++ b/nano/node/daemonconfig.cpp @@ -32,11 +32,6 @@ nano::error nano::daemon_config::serialize_toml (nano::tomlconfig & toml) opencl_l.put ("enable", opencl_enable); toml.put_child ("opencl", opencl_l); - nano::tomlconfig pow_server_l; - pow_server.serialize_toml (pow_server_l); - nano::tomlconfig pow_server (pow_server_l); - toml.put_child ("nano_pow_server", pow_server); - return toml.get_error (); } @@ -62,12 +57,6 @@ nano::error nano::daemon_config::deserialize_toml (nano::tomlconfig & toml) opencl.deserialize_toml (*opencl_l); } - auto pow_l (toml.get_optional_child ("nano_pow_server")); - if (!toml.get_error () && pow_l) - { - pow_server.deserialize_toml (*pow_l); - } - return toml.get_error (); } diff --git a/nano/node/daemonconfig.hpp b/nano/node/daemonconfig.hpp index 0282167cce..4bbf5bb17b 100644 --- a/nano/node/daemonconfig.hpp +++ b/nano/node/daemonconfig.hpp @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include #include @@ -23,7 +22,6 @@ class daemon_config nano::node_config node; bool opencl_enable{ false }; nano::opencl_config opencl; - nano::node_pow_server_config pow_server; boost::filesystem::path data_path; }; diff --git a/nano/node/node_pow_server_config.cpp b/nano/node/node_pow_server_config.cpp deleted file mode 100644 index 1258903645..0000000000 --- a/nano/node/node_pow_server_config.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -nano::error nano::node_pow_server_config::serialize_toml (nano::tomlconfig & toml) const -{ - toml.put ("enable", enable, "Value is currently not in use. Enable or disable starting Nano PoW Server as a child process.\ntype:bool"); - toml.put ("nano_pow_server_path", pow_server_path, "Value is currently not in use. Path to the nano_pow_server executable.\ntype:string,path"); - return toml.get_error (); -} - -nano::error nano::node_pow_server_config::deserialize_toml (nano::tomlconfig & toml) -{ - toml.get_optional ("enable", enable); - toml.get_optional ("nano_pow_server_path", pow_server_path); - - return toml.get_error (); -} diff --git a/nano/node/node_pow_server_config.hpp b/nano/node/node_pow_server_config.hpp deleted file mode 100644 index 531b5aa992..0000000000 --- a/nano/node/node_pow_server_config.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include - -#include -#include - -#include - -namespace nano -{ -class tomlconfig; - -inline std::string get_default_pow_server_filepath () -{ - boost::system::error_code err; - auto running_executable_filepath = boost::dll::program_location (err); - - // Construct the nano_pow_server executable file path based on where the currently running executable is found. - auto pow_server_filepath = running_executable_filepath.parent_path () / "nano_pow_server"; - if (running_executable_filepath.has_extension ()) - { - pow_server_filepath.replace_extension (running_executable_filepath.extension ()); - } - - return pow_server_filepath.string (); -} - -class node_pow_server_config final -{ -public: - nano::error serialize_toml (nano::tomlconfig & toml) const; - nano::error deserialize_toml (nano::tomlconfig & toml); - - bool enable{ false }; - std::string pow_server_path{ nano::get_default_pow_server_filepath () }; -}; -} From 22d67477d3c8f2e3618dd4c8044668307db87809 Mon Sep 17 00:00:00 2001 From: Dimitrios Siganos Date: Thu, 12 Jan 2023 23:55:17 +0000 Subject: [PATCH 4/4] Remove references to nano-pow-server from build scripts --- ci/build-deploy.sh | 1 - docker/node/Dockerfile | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ci/build-deploy.sh b/ci/build-deploy.sh index 202e9563d0..086bf835fd 100755 --- a/ci/build-deploy.sh +++ b/ci/build-deploy.sh @@ -27,7 +27,6 @@ fi cmake \ -G'Unix Makefiles' \ -DACTIVE_NETWORK=nano_${NETWORK_CFG}_network \ --DNANO_POW_SERVER=ON \ -DNANO_GUI=ON \ -DPORTABLE=1 \ -DCMAKE_BUILD_TYPE=${CONFIGURATION} \ diff --git a/docker/node/Dockerfile b/docker/node/Dockerfile index 50a054fc82..42f464f45c 100644 --- a/docker/node/Dockerfile +++ b/docker/node/Dockerfile @@ -13,13 +13,11 @@ RUN \ cmake /tmp/src \ -DCI_BUILD=${CI_BUILD} \ -DPORTABLE=1 \ --DACTIVE_NETWORK=nano_${NETWORK}_network \ --DNANO_POW_SERVER=ON +-DACTIVE_NETWORK=nano_${NETWORK}_network RUN \ make nano_node -j $(nproc) && \ make nano_rpc -j $(nproc) && \ -make nano_pow_server -j $(nproc) && \ cd .. && \ echo ${NETWORK} >/etc/nano-network @@ -30,7 +28,6 @@ useradd --uid 1000 --gid nanocurrency --shell /bin/bash --create-home nanocurren COPY --from=0 /tmp/build/nano_node /usr/bin COPY --from=0 /tmp/build/nano_rpc /usr/bin -COPY --from=0 /tmp/build/nano_pow_server /usr/bin COPY --from=0 /tmp/src/api/ /usr/bin/api/ COPY --from=0 /etc/nano-network /etc COPY docker/node/entry.sh /usr/bin/entry.sh