remove libjuice; add i2psam

pull/225/head
larteyoh 3 months ago
parent e23e8bae35
commit 2136e2b284

6
.gitmodules vendored

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

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

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

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

2
external/cxxopts vendored

@ -1 +1 @@
Subproject commit 44739d3023155fbf5f93937e22a68c9a429f7b89
Subproject commit e84ab5f67ca34dfb6d5b1f6801e1d6f338b8ebe5

2
external/i2pd vendored

@ -1 +1 @@
Subproject commit fb420bb563a3ebf8803faaa390ba6b2bb840d872
Subproject commit 245e6b6efdb2ffd9019dd6c61e9819e70024fdad

1
external/i2psam vendored

@ -0,0 +1 @@
Subproject commit 49182ee50208baaa94fd43ec25220e87e4c2b00f

2
external/json vendored

@ -1 +1 @@
Subproject commit b6d00d18974358ab1d55dcc3379d0ee3052deb4e
Subproject commit 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03

1
external/libjuice vendored

@ -1 +0,0 @@
Subproject commit 5f89b7490c2222257ee3bcd16cfa8e86caf4c72b

@ -17,10 +17,6 @@
#include <cxxopts.hpp>
#if defined(NEROSHOP_USE_LIBJUICE)
#include <juice/juice.h>
#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;
}

Loading…
Cancel
Save