From c1f8c061c7c45346c0887238f799f3e77c0d0ba4 Mon Sep 17 00:00:00 2001 From: Dario Date: Thu, 28 May 2020 15:15:28 +0200 Subject: [PATCH] Add hedera proto files (in submodule) and in build config --- .gitmodules | 2 +- CMakeLists.txt | 7 +++++-- README | 3 ++- compile_proto.sh | 8 ++++++++ src/cpp/ServerConfig.cpp | 3 +++ src/cpp/ServerConfig.h | 1 + src/proto | 2 +- 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 2f85c0ab3..170327bc0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ url = https://github.com/MariaDB/mariadb-connector-c.git [submodule "src/proto"] path = src/proto - url = ssh://git@***REMOVED***/~/gradido_protocol + url = ssh://git@***REMOVED***:18521/~/_protobuf/gradido_protobuf [submodule "dependencies/iroha-ed25519"] path = dependencies/iroha-ed25519 url = ssh://git@***REMOVED***/~/forks/iroha-ed25519.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a5e9a3f40..76f8708be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,8 @@ FILE(GLOB CRYPTO "src/cpp/Crypto/*.h" "src/cpp/Crypto/*.cpp") FILE(GLOB MAIN "src/cpp/*.cpp" "src/cpp/*.c" "src/cpp/*.h") FILE(GLOB MYSQL "src/cpp/MySQL/*.cpp" "src/cpp/MySQL/*.h" "src/cpp/MySQL/Poco/*.h") FILE(GLOB PROTO_GRADIDO "src/cpp/proto/gradido/*.cc" "src/cpp/proto/gradido/*.h") +FILE(GLOB PROTO_HEDERA "src/cpp/proto/hedera/*.cc" "src/cpp/proto/hedera/*.h") + # used only for test project FILE(GLOB TEST "src/cpp/test/*.cpp" "src/cpp/test/*.h") @@ -38,14 +40,15 @@ SET(LOCAL_SRCS ${CONTROLLER} ${TINF} ${MAIN} ${HTTPInterface} ${JSONInterface} ${CRYPTO} ${MODEL} ${MODEL_TABLE} ${MODEL_EMAIL} ${SINGLETON_MANAGER} ${LIB_SRC} ${MYSQL} ${TASKS} - ${PROTO_GRADIDO} + ${PROTO_GRADIDO} ${PROTO_HEDERA} ) aux_source_directory("src/cpp" LOCAL_SRCS) if(MSVC) # src source_group("controller" FILES ${CONTROLLER}) -source_group("proto" FILES ${PROTO_GRADIDO}) +source_group("proto\\gradido" FILES ${PROTO_GRADIDO}) +source_group("proto\\hedera" FILES ${PROTO_HEDERA}) source_group("tinf" FILES ${TINF}) source_group("crypto" FILES ${CRYPTO}) source_group("tasks" FILES ${TASKS}) diff --git a/README b/README index 2b7f02ef8..f6ca48a88 100644 --- a/README +++ b/README @@ -16,12 +16,13 @@ cd ../../../ cd dependencies/mariadb-connector-c mkdir build cd build -cmake .. +cmake -DWITH_SSL=OFF .. cd ../../../ # get more dependencies with conan (need conan from https://conan.io/) mkdir build && cd build +conan remote add inexor https://api.bintray.com/conan/inexorgame/inexor-conan # conan install .. -s build_type=Debug conan install .. diff --git a/compile_proto.sh b/compile_proto.sh index 2429fdeea..ce0eeabe4 100755 --- a/compile_proto.sh +++ b/compile_proto.sh @@ -7,3 +7,11 @@ if [ ! -d "./src/cpp/proto/gradido" ] ; then fi protoc --cpp_out=./src/cpp/proto/gradido --proto_path=./src/proto/gradido ./src/proto/gradido/*.proto + +if [ ! -d "./src/cpp/proto/hedera" ] ; then + mkdir ./src/cpp/proto/hedera +fi + + +protoc --cpp_out=./src/cpp/proto/hedera --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto + diff --git a/src/cpp/ServerConfig.cpp b/src/cpp/ServerConfig.cpp index 618584a3d..527effc37 100644 --- a/src/cpp/ServerConfig.cpp +++ b/src/cpp/ServerConfig.cpp @@ -49,6 +49,7 @@ namespace ServerConfig { std::string g_versionString = ""; bool g_disableEmail = false; ServerSetupType g_ServerSetupType = SERVER_TYPE_PRODUCTION; + std::string g_gRPCRelayServerFullURL; #ifdef __linux__ #include @@ -210,6 +211,8 @@ namespace ServerConfig { auto serverSetupTypeString = cfg.getString("ServerSetupType", ""); g_ServerSetupType = getServerSetupTypeFromString(serverSetupTypeString); + g_gRPCRelayServerFullURL = cfg.getString("grpc.server", ""); + return true; } diff --git a/src/cpp/ServerConfig.h b/src/cpp/ServerConfig.h index f093edf75..29bb3bd40 100644 --- a/src/cpp/ServerConfig.h +++ b/src/cpp/ServerConfig.h @@ -58,6 +58,7 @@ namespace ServerConfig { extern std::string g_versionString; extern bool g_disableEmail; extern ServerSetupType g_ServerSetupType; + extern std::string g_gRPCRelayServerFullURL; bool loadMnemonicWordLists(); bool initServerCrypto(const Poco::Util::LayeredConfiguration& cfg); diff --git a/src/proto b/src/proto index 9004e6978..9149b4552 160000 --- a/src/proto +++ b/src/proto @@ -1 +1 @@ -Subproject commit 9004e6978ac3dafcc635b2ffcf8bc6a156451cca +Subproject commit 9149b4552de8da88d6a3303b24b751630ce54bf5