Remove nano pow server (#4043)

* Remove nano-pow-server from git and cmake files

Remove nano-pw-server from git repo and from cmake files.

* Remove commented out code that used to spawn nano-pow-server

We are rmeoving nano-pow-server so it is not relevant anymore.

* 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.

* Remove references to nano-pow-server from build scripts
This commit is contained in:
Dimitrios Siganos 2023-01-13 12:37:57 +00:00 committed by GitHub
commit 48edec9b7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1 additions and 132 deletions

3
.gitmodules vendored
View file

@ -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

View file

@ -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)

View file

@ -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} \

View file

@ -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

@ -1 +0,0 @@
Subproject commit 00591aeae94bc52d2f087bcb1bf255396f59b42f

View file

@ -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<boost::process::child> rpc_process;
std::unique_ptr<boost::process::child> 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<boost::process::child> (config.pow_server.pow_server_path, "--config_path", data_path / "config-nano-pow-server.toml");
}*/
std::unique_ptr<nano::rpc> rpc;
std::unique_ptr<nano::rpc_handler_interface> rpc_handler;
if (config.rpc_enable)

View file

@ -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<boost::process::child> rpc_process;
std::unique_ptr<boost::process::child> 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<boost::process::child> (config.pow_server.pow_server_path, "--config_path", data_path / "config-nano-pow-server.toml");
}
std::unique_ptr<nano::rpc> rpc;
std::unique_ptr<nano::rpc_handler_interface> 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 ();
});

View file

@ -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

View file

@ -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 ();
}

View file

@ -1,7 +1,6 @@
#pragma once
#include <nano/lib/errors.hpp>
#include <nano/node/node_pow_server_config.hpp>
#include <nano/node/node_rpc_config.hpp>
#include <nano/node/nodeconfig.hpp>
#include <nano/node/openclconfig.hpp>
@ -23,7 +22,6 @@ public:
nano::node_config node;
bool opencl_enable{ false };
nano::opencl_config opencl;
nano::node_pow_server_config pow_server;
boost::filesystem::path data_path;
};

View file

@ -1,17 +0,0 @@
#include <nano/lib/tomlconfig.hpp>
#include <nano/node/node_pow_server_config.hpp>
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<bool> ("enable", enable);
toml.get_optional<std::string> ("nano_pow_server_path", pow_server_path);
return toml.get_error ();
}

View file

@ -1,38 +0,0 @@
#pragma once
#include <nano/lib/rpcconfig.hpp>
#include <boost/dll/runtime_symbol_info.hpp>
#include <boost/filesystem.hpp>
#include <string>
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 () };
};
}