From d32b8ea01c3b6a5858f7f71bdadf8ba27de21c7d Mon Sep 17 00:00:00 2001 From: Russel Waters Date: Thu, 24 Oct 2019 09:49:21 -0400 Subject: [PATCH] include nano_pow_server as a submodule and build into ci framework for tagged releases (#2333) * add nano-pow-server submodule add NANO_POW_SERVER defaulting to off that when enabled will build the nano-pow-server and include them with the artifact release bundle Update build artifacts use known paths to distribute module targets to work around limitations on cmake prior to 3.13 3.9.5 is included with build, this provides compatibility rehome nano-pow-server module in the root project source updating install targets appropriately on appveyor tag as NOT_ARTIFACT when building * check for definition of APPVEYOR_REPO_TAG_NAME * cleanup cmake file * casing matters with targets :) * whitespace --- .gitmodules | 3 +++ CMakeLists.txt | 18 ++++++++++++++++-- appveyor.yml | 4 +++- ci/build-deploy.sh | 1 + docker/node/Dockerfile | 4 +++- nano-pow-server | 1 + 6 files changed, 27 insertions(+), 4 deletions(-) create mode 160000 nano-pow-server diff --git a/.gitmodules b/.gitmodules index c0340b2a..5d31006c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,3 +18,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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 64470631..9f2c41b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ set (NANO_GUI OFF CACHE BOOL "") set (NANO_TEST OFF CACHE BOOL "") set (NANO_SECURE_RPC OFF CACHE BOOL "") set (NANO_ROCKSDB OFF CACHE BOOL "") +set (NANO_POW_SERVER OFF CACHE BOOL "") set (NANO_WARN_TO_ERR OFF CACHE BOOL "") set (NANO_TIMED_LOCKS 0 CACHE INTEGER "") @@ -338,6 +339,9 @@ add_library (blake2 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) @@ -372,7 +376,6 @@ if (NANO_TEST OR RAIBLOCKS_TEST) add_subdirectory(nano/rpc_test) add_subdirectory(nano/slow_test) endif () - if (NANO_GUI OR RAIBLOCKS_GUI) install (FILES ${PROJECT_BINARY_DIR}/config-node.toml.sample DESTINATION .) install (FILES ${PROJECT_BINARY_DIR}/config-rpc.toml.sample DESTINATION .) @@ -473,6 +476,10 @@ if (NANO_GUI OR RAIBLOCKS_GUI) install (DIRECTORY ${Qt5_DIR}/../../QtTest.framework DESTINATION Nano.app/Contents/Frameworks) install (DIRECTORY ${Qt5_DIR}/../../QtWidgets.framework DESTINATION Nano.app/Contents/Frameworks) install (FILES "${Qt5_DIR}/../../../plugins/platforms/libqcocoa.dylib" DESTINATION Nano.app/Contents/PlugIns/platforms) + if (NANO_POW_SERVER) + install (TARGETS nano_pow_server DESTINATION Nano.app/Contents/MacOS) + install (DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public DESTINATION Nano.app/Contents/MacOS) + endif() install (FILES Nano.icns DESTINATION Nano.app/Contents/Resources) elseif (WIN32) if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") @@ -497,6 +504,10 @@ if (NANO_GUI OR RAIBLOCKS_GUI) get_filename_component (Qt5_bin_DIR ${Qt5_DIR}/../../../bin ABSOLUTE) install (TARGETS nano_wallet DESTINATION .) install (TARGETS nano_wallet_com DESTINATION .) + 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 .) @@ -509,9 +520,12 @@ if (NANO_GUI OR RAIBLOCKS_GUI) install(TARGETS nano_wallet RUNTIME DESTINATION . ) + if (NANO_POW_SERVER) + install (TARGETS nano_pow_server DESTINATION .) + install (DIRECTORY ${PROJECT_SOURCE_DIR}/nano-pow-server/public DESTINATION .) + endif () endif () endif () set (CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/LICENSE) - include (CPack) diff --git a/appveyor.yml b/appveyor.yml index 74723c59..61ce811a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,9 @@ install: - del temp.txt - echo set(VCPKG_BUILD_TYPE release) >> C:\Tools\vcpkg\triplets\x64-windows.cmake - vcpkg install rocksdb:%PLATFORM%-windows - - cmake -DNANO_GUI=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DACTIVE_NETWORK=%NETWORK% -DQt5_DIR="C:\Qt\5.9\msvc2017_64\lib\cmake\Qt5" -DNANO_SIMD_OPTIMIZATIONS=TRUE -DBoost_COMPILER="-vc141" -DBOOST_ROOT="C:/Libraries/boost_1_67_0" -DBOOST_LIBRARYDIR="C:/Libraries/boost_1_67_0/lib64-msvc-14.1" -G "Visual Studio 15 2017 Win64" -DNANO_ROCKSDB=ON -DROCKSDB_LIBRARIES="%VCPKG_DIR%\installed\x64-windows\lib\rocksdb.lib" -DROCKSDB_INCLUDE_DIRS="%VCPKG_DIR%\installed\x64_windows\include" -DZLIB_LIBRARY=%VCPKG_DIR%\installed\x64-windows\lib\zlib.lib -DZLIB_INCLUDE_DIR=%VCPKG_DIR%\installed\x64-windows\include -DIPHLPAPI_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/iphlpapi.lib" -DWINSOCK2_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/WS2_32.lib" . + - IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (set APPVEYOR_REPO_TAG_NAME=NOT_ARTIFACT) + - set TRAVIS_TAG=%APPVEYOR_REPO_TAG_NAME% + - cmake -DNANO_GUI=ON -DNANO_POW_SERVER=ON -DCI_BUILD=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DACTIVE_NETWORK=%NETWORK% -DQt5_DIR="C:\Qt\5.9\msvc2017_64\lib\cmake\Qt5" -DNANO_SIMD_OPTIMIZATIONS=TRUE -DBoost_COMPILER="-vc141" -DBOOST_ROOT="C:/Libraries/boost_1_67_0" -DBOOST_LIBRARYDIR="C:/Libraries/boost_1_67_0/lib64-msvc-14.1" -G "Visual Studio 15 2017 Win64" -DNANO_ROCKSDB=ON -DROCKSDB_LIBRARIES="%VCPKG_DIR%\installed\x64-windows\lib\rocksdb.lib" -DROCKSDB_INCLUDE_DIRS="%VCPKG_DIR%\installed\x64_windows\include" -DZLIB_LIBRARY=%VCPKG_DIR%\installed\x64-windows\lib\zlib.lib -DZLIB_INCLUDE_DIR=%VCPKG_DIR%\installed\x64-windows\include -DIPHLPAPI_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/iphlpapi.lib" -DWINSOCK2_LIBRARY="C:/Program Files (x86)/Windows Kits/10/Lib/10.0.14393.0/um/x64/WS2_32.lib" . - ps: Invoke-WebRequest -Uri https://aka.ms/vs/15/release/vc_redist.x64.exe -OutFile .\vc_redist.x64.exe build: diff --git a/ci/build-deploy.sh b/ci/build-deploy.sh index 35ea9e87..d6aef013 100755 --- a/ci/build-deploy.sh +++ b/ci/build-deploy.sh @@ -22,6 +22,7 @@ fi cmake \ -G'Unix Makefiles' \ -DACTIVE_NETWORK=nano_${NETWORK_CFG}_network \ + -DNANO_POW_SERVER=ON \ -DNANO_GUI=ON \ -DNANO_ROCKSDB=ON \ -DCMAKE_BUILD_TYPE=${CONFIGURATION} \ diff --git a/docker/node/Dockerfile b/docker/node/Dockerfile index ae831bfa..fd4705db 100644 --- a/docker/node/Dockerfile +++ b/docker/node/Dockerfile @@ -7,15 +7,17 @@ ADD ./ /tmp/src RUN mkdir /tmp/build && \ cd /tmp/build && \ - cmake /tmp/src -DCI_BUILD=${CI_BUILD} -DBOOST_ROOT=${BOOST_ROOT} -DACTIVE_NETWORK=nano_${NETWORK}_network -DNANO_ROCKSDB=ON && \ + cmake /tmp/src -DCI_BUILD=${CI_BUILD} -DBOOST_ROOT=${BOOST_ROOT} -DACTIVE_NETWORK=nano_${NETWORK}_network -DNANO_ROCKSDB=ON -DNANO_POW_SERVER=ON && \ make nano_node -j $(nproc) && \ make nano_rpc -j $(nproc) && \ + make nano_pow_server -j $(nproc) && \ cd .. && \ echo ${NETWORK} > /etc/nano-network FROM ubuntu:16.04 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 /etc/nano-network /etc COPY docker/node/entry.sh /entry.sh COPY docker/node/config /usr/share/nano/config diff --git a/nano-pow-server b/nano-pow-server new file mode 160000 index 00000000..32e78268 --- /dev/null +++ b/nano-pow-server @@ -0,0 +1 @@ +Subproject commit 32e7826865ce4af069f79eceeefe2a1092e28b53