From 2136e2b284535dc5b8381cdf255babd2c5b96d8f Mon Sep 17 00:00:00 2001 From: larteyoh Date: Fri, 9 Feb 2024 11:06:34 +0000 Subject: [PATCH] remove libjuice; add i2psam --- .gitmodules | 6 +++--- CMakeLists.txt | 15 ++++----------- README.md | 5 ++--- external/CMakeLists.txt | 5 ++++- external/cxxopts | 2 +- external/i2pd | 2 +- external/i2psam | 1 + external/json | 2 +- external/libjuice | 1 - src/daemon/main.cpp | 32 +------------------------------- 10 files changed, 18 insertions(+), 53 deletions(-) create mode 160000 external/i2psam delete mode 160000 external/libjuice diff --git a/.gitmodules b/.gitmodules index 016cffe..777cf86 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,6 +19,6 @@ [submodule "external/i2pd"] path = external/i2pd url = https://github.com/PurpleI2P/i2pd.git -[submodule "external/libjuice"] - path = external/libjuice - url = https://github.com/paullouisageneau/libjuice.git +[submodule "external/i2psam"] + path = external/i2psam + url = https://github.com/i2p/i2psam.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 932917a..77fa837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -387,13 +387,9 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/i2pd/libi2pd ${CMAKE_CU set(i2pd_src ${CMAKE_CURRENT_SOURCE_DIR}/build/libi2pd.a ${CMAKE_CURRENT_SOURCE_DIR}/build/libi2pd_client.a) ###################################### -# libjuice -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/libjuice/include/) -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/external/build/libjuice-static.a") - option(NEROSHOP_USE_LIBJUICE "Build neroshop with libjuice" ON) - message(STATUS "Using libjuice") - set(juice_src ${CMAKE_CURRENT_SOURCE_DIR}/external/build/libjuice-static.a) -endif() +# i2psam +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external/i2psam/) +set(i2psam_src ${CMAKE_CURRENT_SOURCE_DIR}/build/libi2psam.a) ###################################### # neroshop link directories @@ -488,12 +484,9 @@ set(daemon_executable "neromon") set(daemon_src ${neroshop_crypto_src} ${neroshop_database_src} ${neroshop_network_src} ${NEROSHOP_CORE_SRC_DIR}/protocol/messages/msgpack.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/p2p/kademlia.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/p2p/mapper.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/p2p/node.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/p2p/routing_table.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/rpc/json_rpc.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/transport/client.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/transport/ip_address.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/transport/server.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/transport/zmq_client.cpp ${NEROSHOP_CORE_SRC_DIR}/protocol/transport/zmq_server.cpp ${NEROSHOP_CORE_SRC_DIR}/tools/base64.cpp ${NEROSHOP_CORE_SRC_DIR}/tools/logger.cpp ${NEROSHOP_CORE_SRC_DIR}/tools/timer.cpp ${NEROSHOP_CORE_SRC_DIR}/tools/timestamp.cpp) add_executable(${daemon_executable} src/daemon/main.cpp ${daemon_src})#target_link_libraries(daemon ${curl_src} ${OPENSSL_LIBRARIES}) # curl requires both openssl(used in monero) and zlib(used in dokun-ui) install(TARGETS ${daemon_executable} DESTINATION bin) -if(NEROSHOP_USE_LIBJUICE) - target_compile_definitions(${daemon_executable} PRIVATE NEROSHOP_USE_LIBJUICE) -endif() target_compile_definitions(${daemon_executable} PRIVATE NEROSHOP_DEBUG) target_include_directories(${daemon_executable} PRIVATE #[[${CMAKE_CURRENT_SOURCE_DIR}/src/]]) -target_link_libraries(${daemon_executable} ${monero_cpp_src} ${sqlite_src} ${raft_src} ${monero_src} ${i2pd_src} ${juice_src})#set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl") # fixes undefined reference to symbol 'dlsym@@GLIBC_2.2.5' error +target_link_libraries(${daemon_executable} ${monero_cpp_src} ${sqlite_src} ${raft_src} ${monero_src} ${i2pd_src})#set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl") # fixes undefined reference to symbol 'dlsym@@GLIBC_2.2.5' error ###################################### # neroshop-console diff --git a/README.md b/README.md index c3b5baf..ad247e9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ NeroShop is a decentralized peer-to-peer marketplace for trading goods and servi > __Disclaimer: The neroshop team is comprised of a single developer that operates independently > and is not affiliated, associated, authorized, endorsed by, or in any way officially connected > with the Monero project, Monero team or any other organization.__ -> __Also, this is an experimental / hobbyist project that is still in its early stages of development so use it at your own risk.__ ## Table of contents @@ -106,7 +105,7 @@ https://user-images.githubusercontent.com/58671384/219222567-f170f728-be31-43d5- | [cxxopts](https://github.com/jarro2783/cxxopts) | ? | command line option parser | :heavy_check_mark: :package: | | [libzmq](https://github.com/zeromq/libzmq) | ? | networking | :grey_question: | | [libi2pd](https://github.com/PurpleI2P/i2pd) | latest | network proxy | :grey_question: :package: | -| [libjuice](https://github.com/paullouisageneau/libjuice) | ? | NAT traversal (clearnet) | :grey_question: :package: | +| [i2psam](https://github.com/i2p/i2psam) | ? | network proxy | :grey_question: :package: | ### Compiling neroshop from source **0. Install prerequisites** @@ -210,7 +209,7 @@ To build with [**CMake**](https://cmake.org/): ```bash # Build external libraries cd external/ -cmake . && cmake --build . --target juice-static +cmake . make -j$(nproc) cd .. ``` diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index bc08f38..6ce4b99 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -63,7 +63,10 @@ endforeach() add_library(${i2pd_client_target} STATIC ${i2pd_client_srcs}) target_include_directories(${i2pd_client_target} PUBLIC i2pd/i18n/ i2pd/libi2pd/ i2pd/libi2pd_client/) -add_subdirectory(libjuice) +set(i2psam_target "i2psam") +set(i2psam_srcs i2psam/i2psam.cpp) +add_library(${i2psam_target} STATIC ${i2psam_srcs}) +target_include_directories(${i2psam_target} PUBLIC i2psam/) #[[ set(_target "") diff --git a/external/cxxopts b/external/cxxopts index 44739d3..e84ab5f 160000 --- a/external/cxxopts +++ b/external/cxxopts @@ -1 +1 @@ -Subproject commit 44739d3023155fbf5f93937e22a68c9a429f7b89 +Subproject commit e84ab5f67ca34dfb6d5b1f6801e1d6f338b8ebe5 diff --git a/external/i2pd b/external/i2pd index fb420bb..245e6b6 160000 --- a/external/i2pd +++ b/external/i2pd @@ -1 +1 @@ -Subproject commit fb420bb563a3ebf8803faaa390ba6b2bb840d872 +Subproject commit 245e6b6efdb2ffd9019dd6c61e9819e70024fdad diff --git a/external/i2psam b/external/i2psam new file mode 160000 index 0000000..49182ee --- /dev/null +++ b/external/i2psam @@ -0,0 +1 @@ +Subproject commit 49182ee50208baaa94fd43ec25220e87e4c2b00f diff --git a/external/json b/external/json index b6d00d1..9cca280 160000 --- a/external/json +++ b/external/json @@ -1 +1 @@ -Subproject commit b6d00d18974358ab1d55dcc3379d0ee3052deb4e +Subproject commit 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03 diff --git a/external/libjuice b/external/libjuice deleted file mode 160000 index 5f89b74..0000000 --- a/external/libjuice +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5f89b7490c2222257ee3bcd16cfa8e86caf4c72b diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index b943987..824c68a 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -17,10 +17,6 @@ #include -#if defined(NEROSHOP_USE_LIBJUICE) -#include -#endif - #define NEROMON_TAG "\033[1;95m[neromon]:\033[0m " using namespace neroshop; @@ -216,28 +212,6 @@ int main(int argc, char** argv) ip_address = NEROSHOP_ANY_ADDRESS; } //------------------------------------------------------- - #if defined(NEROSHOP_USE_LIBJUICE) - /*juice_log_level_t log_level = JUICE_LOG_LEVEL_VERBOSE;//JUICE_LOG_LEVEL_INFO; - juice_server_config_t config; - memset(&config, 0, sizeof(config)); // ? - config.port = NEROSHOP_P2P_DEFAULT_PORT;////node.get_port(); - //config.credentials_count - //config.credentials - //config.bind_address = "0.0.0.0"; - //config.external_address - //config.relay_port_range_begin - //config.relay_port_range_end - //config.max_allocations - - //juice_set_log_handler(log_handler); - juice_set_log_level(log_level); - - juice_server_t *server = juice_server_create(&config); - if (!server) { - fprintf(stderr, "Server initialization failed\n"); - }*/ - #endif - //------------------------------------------------------- neroshop::Node node("0.0.0.0"/*ip_address*/, NEROSHOP_P2P_DEFAULT_PORT, true); if(result.count("bootstrap")) { @@ -263,9 +237,5 @@ int main(int argc, char** argv) ipc_thread.join(); dht_thread.join(); - #if defined(NEROSHOP_USE_LIBJUICE) - ////juice_server_destroy(server); - #endif - - return 0; + return 0; }