-
Notifications
You must be signed in to change notification settings - Fork 297
Split scheme to server and client ones #1550
Conversation
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
schema/CMakeLists.txt
Outdated
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(SCHEMA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../shared_model/schema/) | ||
compile_proto_only_grpc_to_cpp(endpoint.proto "-I${CMAKE_CURRENT_SOURCE_DIR}/../shared_model/schema/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-I${SCHEMA_PATH} ?
shared_model/clean.sh
Outdated
@@ -1,4 +1,4 @@ | |||
#!/bin/bash | |||
rm ../schema/*.{cc,h} | |||
rm schema/*.pb.{cc,h} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that all generated files are inside build directory do we still need this?
shared_model/clean.sh
Outdated
@@ -1,4 +1,4 @@ | |||
#!/bin/bash | |||
rm ../schema/*.{cc,h} | |||
rm schema/*.pb.{cc,h} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that all generated files are inside build directory do we still need this?
shared_model/schema/CMakeLists.txt
Outdated
target_link_libraries(schema | ||
protobuf | ||
) | ||
set_target_properties(schema PROPERTIES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use target_include_directories? It is cleaner and more idiomatic.
Also, I think we need PUBLIC for include directories, since they are used by generated files themselves (e. g. block includes transaction)
shared_model_stateless_validation | ||
shared_model_cryptography | ||
) | ||
if (IROHA_ROOT_PROJECT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this conditional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed build of standalone shared_model build with tests
Just try to build shared_model without any fixes
Signed-off-by: Kitsu <mail@kitsu.me>
schema/CMakeLists.txt
Outdated
compile_proto_to_grpc_cpp(mst.proto "-I${SM_SCHEMA_PATH}") | ||
|
||
add_library(endpoint | ||
# ${SCHEMA_OUT_DIR}/endpoint.pb.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment?
|
||
set(SM_SCHEMA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../shared_model/schema/) | ||
set(SCHEMA_PATH ${SM_SCHEMA_PATH}) | ||
compile_proto_only_grpc_to_cpp(endpoint.proto "-I${SM_SCHEMA_PATH}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logically it should be SCHEMA_PATH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, the model proto should be included for the building grpc services
example/java/prepare.sh
Outdated
@@ -1,5 +1,5 @@ | |||
#!/usr/bin/env bash | |||
CURDIR="$(cd "$(dirname "$0")"; pwd)" | |||
IROHA_HOME="$(dirname $(dirname "${CURDIR}"))" | |||
cmake -H$IROHA_HOME -Bbuild -DSWIG_JAVA=ON -DSWIG_JAVA_PKG="jp.co.soramitsu.iroha"; | |||
cmake -H$IROHA_HOME -Bbuild -DSWIG_JAVA=ON -DSWIG_JAVA_PKG="jp.co.soramitsu.iroha" -GNinja |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that every script user has Ninja installed, so it seems better to leave the default value.
shared_model/schema/CMakeLists.txt
Outdated
compile_proto_to_cpp(proposal.proto) | ||
compile_proto_to_cpp(qry_responses.proto) | ||
compile_proto_to_cpp(queries.proto) | ||
compile_proto_to_cpp(endpoint.proto "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""
looks reduntant, please remove.
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
SonarQube analysis reported 5 issues
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason to rename responses to qry_responses?
There's none actually. The first impl considered splitting endpoint to torii_responses, so qry_responses looks more accurate and meaningful naming |
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Signed-off-by: Kitsu <mail@kitsu.me>
Description of the Change
block.proto
toblock.proto
andtransaction.proto
Benefits
Weaker coupling of shared model component
Possible Drawbacks
Building grpc protobuf services now isn't straightforward and require
SCHEMA_PATH
variable to be set