diff --git a/build.gradle b/build.gradle index e47ff373cb..3fd5a2aef3 100644 --- a/build.gradle +++ b/build.gradle @@ -336,7 +336,6 @@ configure(project(':desktop')) { dependencies { compile project(':core') - compile project(':grpc') compile "net.glxn:qrgen:$qrgenVersion" compile "de.jensd:fontawesomefx:$fontawesomefxVersion" compile "de.jensd:fontawesomefx-commons:$fontawesomefxCommonsVersion" diff --git a/cli/src/main/java/bisq/cli/app/BisqCliMain.java b/cli/src/main/java/bisq/cli/app/BisqCliMain.java index dbc78c641d..5988324c12 100644 --- a/cli/src/main/java/bisq/cli/app/BisqCliMain.java +++ b/cli/src/main/java/bisq/cli/app/BisqCliMain.java @@ -17,6 +17,20 @@ package bisq.cli.app; +import bisq.core.grpc.GetBalanceGrpc; +import bisq.core.grpc.GetBalanceRequest; +import bisq.core.grpc.GetOffersGrpc; +import bisq.core.grpc.GetOffersRequest; +import bisq.core.grpc.GetPaymentAccountsGrpc; +import bisq.core.grpc.GetPaymentAccountsRequest; +import bisq.core.grpc.GetTradeStatisticsGrpc; +import bisq.core.grpc.GetTradeStatisticsRequest; +import bisq.core.grpc.GetVersionGrpc; +import bisq.core.grpc.GetVersionRequest; +import bisq.core.grpc.PlaceOfferGrpc; +import bisq.core.grpc.PlaceOfferRequest; +import bisq.core.grpc.StopServerGrpc; +import bisq.core.grpc.StopServerRequest; import bisq.core.payment.PaymentAccount; import bisq.core.proto.network.CoreNetworkProtoResolver; import bisq.core.proto.persistable.CorePersistenceProtoResolver; @@ -39,20 +53,6 @@ import static java.lang.String.format; -import bisq.grpc.protobuf.GetBalanceGrpc; -import bisq.grpc.protobuf.GetBalanceRequest; -import bisq.grpc.protobuf.GetOffersGrpc; -import bisq.grpc.protobuf.GetOffersRequest; -import bisq.grpc.protobuf.GetPaymentAccountsGrpc; -import bisq.grpc.protobuf.GetPaymentAccountsRequest; -import bisq.grpc.protobuf.GetTradeStatisticsGrpc; -import bisq.grpc.protobuf.GetTradeStatisticsRequest; -import bisq.grpc.protobuf.GetVersionGrpc; -import bisq.grpc.protobuf.GetVersionRequest; -import bisq.grpc.protobuf.PlaceOfferGrpc; -import bisq.grpc.protobuf.PlaceOfferRequest; -import bisq.grpc.protobuf.StopServerGrpc; -import bisq.grpc.protobuf.StopServerRequest; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.StatusRuntimeException; diff --git a/grpc/src/main/java/bisq/grpc/BisqGrpcServer.java b/core/src/main/java/bisq/core/grpc/BisqGrpcServer.java similarity index 88% rename from grpc/src/main/java/bisq/grpc/BisqGrpcServer.java rename to core/src/main/java/bisq/core/grpc/BisqGrpcServer.java index 293fe91e47..8c7dbd454f 100644 --- a/grpc/src/main/java/bisq/grpc/BisqGrpcServer.java +++ b/core/src/main/java/bisq/core/grpc/BisqGrpcServer.java @@ -15,9 +15,8 @@ * along with Bisq. If not, see . */ -package bisq.grpc; +package bisq.core.grpc; -import bisq.core.CoreApi; import bisq.core.offer.Offer; import bisq.core.payment.PaymentAccount; import bisq.core.trade.handlers.TransactionResultHandler; @@ -32,31 +31,11 @@ import lombok.extern.slf4j.Slf4j; -import bisq.grpc.protobuf.GetBalanceGrpc; -import bisq.grpc.protobuf.GetBalanceReply; -import bisq.grpc.protobuf.GetBalanceRequest; -import bisq.grpc.protobuf.GetOffersGrpc; -import bisq.grpc.protobuf.GetOffersReply; -import bisq.grpc.protobuf.GetOffersRequest; -import bisq.grpc.protobuf.GetPaymentAccountsGrpc; -import bisq.grpc.protobuf.GetPaymentAccountsReply; -import bisq.grpc.protobuf.GetPaymentAccountsRequest; -import bisq.grpc.protobuf.GetTradeStatisticsGrpc; -import bisq.grpc.protobuf.GetTradeStatisticsReply; -import bisq.grpc.protobuf.GetTradeStatisticsRequest; -import bisq.grpc.protobuf.GetVersionGrpc; -import bisq.grpc.protobuf.GetVersionReply; -import bisq.grpc.protobuf.GetVersionRequest; -import bisq.grpc.protobuf.PlaceOfferGrpc; -import bisq.grpc.protobuf.PlaceOfferReply; -import bisq.grpc.protobuf.PlaceOfferRequest; -import bisq.grpc.protobuf.StopServerGrpc; -import bisq.grpc.protobuf.StopServerReply; -import bisq.grpc.protobuf.StopServerRequest; import io.grpc.Server; import io.grpc.ServerBuilder; import io.grpc.stub.StreamObserver; + /** * gRPC server. Gets a instance of BisqFacade passed to access data from the running Bisq instance. */ @@ -199,7 +178,7 @@ public class BisqGrpcServer { * Await termination on the main thread since the grpc library uses daemon threads. * Only used for headless version */ - void blockUntilShutdown() throws InterruptedException { + public void blockUntilShutdown() throws InterruptedException { if (server != null) { server.awaitTermination(); } diff --git a/core/src/main/java/bisq/core/CoreApi.java b/core/src/main/java/bisq/core/grpc/CoreApi.java similarity index 99% rename from core/src/main/java/bisq/core/CoreApi.java rename to core/src/main/java/bisq/core/grpc/CoreApi.java index 09d67e495e..2877849147 100644 --- a/core/src/main/java/bisq/core/CoreApi.java +++ b/core/src/main/java/bisq/core/grpc/CoreApi.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.core; +package bisq.core.grpc; import bisq.core.btc.Balances; import bisq.core.monetary.Price; diff --git a/core/src/main/proto/grpc.proto b/core/src/main/proto/grpc.proto index 4ad24c2488..33957fb412 100644 --- a/core/src/main/proto/grpc.proto +++ b/core/src/main/proto/grpc.proto @@ -21,7 +21,7 @@ package io.bisq.protobuffer; // FIXME: IntelliJ does not recognize the import but the compiler does import "pb.proto"; -option java_package = "bisq.grpc.protobuf"; +option java_package = "bisq.core.grpc"; option java_multiple_files = true; /////////////////////////////////////////////////////////////////////////////////////////// diff --git a/grpc/src/main/java/bisq/grpc/BisqGrpcServerMain.java b/grpc/src/main/java/bisq/grpc/BisqGrpcServerMain.java index 7776686a7b..c510ba5664 100644 --- a/grpc/src/main/java/bisq/grpc/BisqGrpcServerMain.java +++ b/grpc/src/main/java/bisq/grpc/BisqGrpcServerMain.java @@ -17,11 +17,12 @@ package bisq.grpc; -import bisq.core.CoreApi; import bisq.core.app.BisqExecutable; import bisq.core.app.BisqHeadlessAppMain; import bisq.core.app.BisqSetup; import bisq.core.app.CoreModule; +import bisq.core.grpc.BisqGrpcServer; +import bisq.core.grpc.CoreApi; import bisq.common.UserThread; import bisq.common.app.AppModule;