forked from such-gitea/wownero-lws
Adapts monero-lws for Wownero cryptocurrency: - Rename all monero-lws-* binaries to wownero-lws-* - Update submodule to point to official Wownero repo - Use Wownero default ports (RPC: 34568, ZMQ: 34569) - Update data directory to ~/.wownero/light_wallet_server - Adapt next_difficulty() calls for Wownero API signature Key technical changes for Wownero compatibility: - BulletproofPlus (RCTTypeBulletproofPlus, type 8) commitment verification: Wownero stores BP+ commitments in 'divided by 8' form. Must call rct::scalarmult8() on outPk commitment before comparing with computed commitment (mask*G + amount*H). This is essential for amount decryption. - Pass rct_type to decode_amount() for proper commitment handling - Handle Wownero's ZMQ JSON format for ecdhTuple (32-byte mask/amount fields) No fork of Wownero is required - uses official codeberg.org/wownero/wownero.
138 lines
4.5 KiB
CMake
138 lines
4.5 KiB
CMake
# Copyright (c) 2018-2020, The Monero Project
|
|
# Copyright (c) 2024-2025, The Wownero Project
|
|
#
|
|
# All rights reserved.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without modification, are
|
|
# permitted provided that the following conditions are met:
|
|
#
|
|
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
# conditions and the following disclaimer.
|
|
#
|
|
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
# of conditions and the following disclaimer in the documentation and/or other
|
|
# materials provided with the distribution.
|
|
#
|
|
# 3. Neither the name of the copyright holder nor the names of its contributors may be
|
|
# used to endorse or promote products derived from this software without specific
|
|
# prior written permission.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
|
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
include_directories(.)
|
|
|
|
find_package(Git)
|
|
|
|
set(MLWS_COMMIT_BRANCH "")
|
|
set(MLWS_COMMIT_DATE "")
|
|
set(MLWS_COMMIT_HASH "")
|
|
if (GIT_FOUND)
|
|
execute_process(
|
|
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
OUTPUT_VARIABLE MLWS_COMMIT_HASH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
execute_process(
|
|
COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
OUTPUT_VARIABLE MLWS_COMMIT_BRANCH
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
execute_process(
|
|
COMMAND "${GIT_EXECUTABLE}" log -1 "--date=format:\"%Y/%m/%d %T\"" "--format=\"%ad\""
|
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
|
OUTPUT_VARIABLE MLWS_COMMIT_DATE
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
endif ()
|
|
|
|
configure_file(lws_version.h.in "${CMAKE_BINARY_DIR}/generated_include/lws_version.h")
|
|
include_directories("${CMAKE_BINARY_DIR}/generated_include")
|
|
|
|
add_subdirectory(lmdb)
|
|
add_subdirectory(wire)
|
|
add_subdirectory(db)
|
|
add_subdirectory(net)
|
|
add_subdirectory(rpc)
|
|
add_subdirectory(util)
|
|
|
|
# For both the server and admin utility.
|
|
set(wownero-lws-common_sources config.cpp error.cpp)
|
|
set(wownero-lws-common_headers config.h error.h fwd.h)
|
|
|
|
add_library(wownero-lws-common ${wownero-lws-common_sources} ${wownero-lws-common_headers})
|
|
target_link_libraries(wownero-lws-common wownero::libraries)
|
|
|
|
add_library(wownero-lws-daemon-common rest_server.cpp scanner.cpp)
|
|
target_include_directories(wownero-lws-daemon-common PUBLIC ${ZMQ_INCLUDE_PATH})
|
|
target_link_libraries(wownero-lws-daemon-common
|
|
PUBLIC
|
|
${WOWNERO_lmdb}
|
|
wownero-lws-common
|
|
wownero-lws-db
|
|
wownero-lws-net
|
|
wownero-lws-rpc
|
|
wownero-lws-rpc-scanner
|
|
wownero-lws-wire-json
|
|
wownero-lws-util
|
|
${Boost_CHRONO_LIBRARY}
|
|
${Boost_COROUTINE_LIBRARY}
|
|
${Boost_CONTEXT_LIBRARY}
|
|
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
|
${Boost_SYSTEM_LIBRARY}
|
|
${Boost_THREAD_LIBRARY}
|
|
${Boost_THREAD_LIBS_INIT}
|
|
${EXTRA_LIBRARIES}
|
|
${ZMQ_LIB}
|
|
${SODIUM_LIBRARY}
|
|
Threads::Threads
|
|
wownero::libraries
|
|
)
|
|
|
|
add_executable(wownero-lws-daemon server_main.cpp)
|
|
target_link_libraries(wownero-lws-daemon
|
|
PRIVATE
|
|
wownero-lws-daemon-common
|
|
wownero-lws-rpc-scanner
|
|
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
|
${Boost_FILESYSTEM_LIBRARY}
|
|
wownero::libraries
|
|
)
|
|
|
|
add_executable(wownero-lws-admin admin_main.cpp)
|
|
target_link_libraries(wownero-lws-admin
|
|
PRIVATE
|
|
wownero-lws-common
|
|
wownero-lws-db
|
|
wownero-lws-rpc
|
|
wownero-lws-wire-json
|
|
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
|
Threads::Threads
|
|
wownero::libraries
|
|
)
|
|
|
|
add_executable(wownero-lws-client client_main.cpp)
|
|
target_link_libraries(wownero-lws-client
|
|
PRIVATE
|
|
wownero-lws-common
|
|
wownero-lws-daemon-common
|
|
wownero-lws-rpc
|
|
wownero-lws-rpc-scanner
|
|
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
|
Threads::Threads
|
|
wownero::libraries
|
|
)
|
|
|
|
install(TARGETS wownero-lws-daemon DESTINATION bin)
|
|
install(TARGETS wownero-lws-admin DESTINATION bin)
|
|
install(TARGETS wownero-lws-client DESTINATION bin)
|