Skip to content

Commit

Permalink
Merge pull request #4427 from ghubstan/mv-grpc-boilerplate-to-daemon
Browse files Browse the repository at this point in the history
Move gRPC boilerplate from :core to :daemon
  • Loading branch information
sqrrm committed Aug 25, 2020
2 parents 30eeb6e + d0397c1 commit 10215b8
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 34 deletions.
17 changes: 4 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,6 @@ configure(project(':core')) {
exclude(module: 'jackson-annotations')
}
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
implementation("io.grpc:grpc-protobuf:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
implementation("io.grpc:grpc-stub:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
compileOnly "javax.annotation:javax.annotation-api:$javaxAnnotationVersion"
runtimeOnly("io.grpc:grpc-netty-shaded:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"

Expand Down Expand Up @@ -577,6 +564,10 @@ configure(project(':daemon')) {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
runtimeOnly("io.grpc:grpc-netty-shaded:$grpcVersion") {
exclude(module: 'guava')
exclude(module: 'animal-sniffer-annotations')
}
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "ch.qos.logback:logback-core:$logbackVersion"
implementation "ch.qos.logback:logback-classic:$logbackVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.core.api;

import bisq.core.grpc.model.AddressBalanceInfo;
import bisq.core.api.model.AddressBalanceInfo;
import bisq.core.monetary.Price;
import bisq.core.offer.Offer;
import bisq.core.offer.OfferPayload;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.core.api;

import bisq.core.monetary.Price;
import bisq.core.offer.CreateOfferService;
Expand All @@ -40,7 +40,7 @@
import static bisq.core.offer.OfferPayload.Direction.BUY;

@Slf4j
public class CoreOffersService {
class CoreOffersService {

private final CreateOfferService createOfferService;
private final OfferBookService offerBookService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.core.api;

import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.locale.FiatCurrency;
Expand All @@ -34,7 +34,7 @@
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CorePaymentAccountsService {
class CorePaymentAccountsService {

private final Config config;
private final AccountAgeWitnessService accountAgeWitnessService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.core.api;

import bisq.core.api.model.AddressBalanceInfo;
import bisq.core.btc.Balances;
import bisq.core.btc.model.AddressEntry;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.btc.wallet.WalletsManager;
import bisq.core.grpc.model.AddressBalanceInfo;

import org.bitcoinj.core.Address;
import org.bitcoinj.core.TransactionConfidence;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc.model;
package bisq.core.api.model;

import bisq.common.Payload;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc.model;
package bisq.core.api.model;

import bisq.common.Payload;

Expand Down
8 changes: 5 additions & 3 deletions daemon/src/main/java/bisq/daemon/app/BisqDaemonMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import bisq.core.app.BisqHeadlessAppMain;
import bisq.core.app.BisqSetup;
import bisq.core.app.CoreModule;
import bisq.core.grpc.GrpcServer;

import bisq.common.UserThread;
import bisq.common.app.AppModule;
Expand All @@ -33,10 +32,14 @@

import lombok.extern.slf4j.Slf4j;



import bisq.daemon.grpc.GrpcServer;

@Slf4j
public class BisqDaemonMain extends BisqHeadlessAppMain implements BisqSetup.BisqSetupListener {

public static void main(String[] args) {
public static void main(String[] args) {
new BisqDaemonMain().execute(args);
}

Expand Down Expand Up @@ -67,7 +70,6 @@ protected void onApplicationLaunched() {
headlessApp.setGracefulShutDownHandler(this);
}


///////////////////////////////////////////////////////////////////////////////////////////
// We continue with a series of synchronous execution tasks
///////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.daemon.grpc;

import bisq.core.grpc.model.OfferInfo;
import bisq.core.api.CoreApi;
import bisq.core.api.model.OfferInfo;
import bisq.core.trade.handlers.TransactionResultHandler;

import bisq.proto.grpc.CreateOfferReply;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.daemon.grpc;

import bisq.core.api.CoreApi;
import bisq.core.payment.PaymentAccount;

import bisq.proto.grpc.CreatePaymentAccountReply;
Expand All @@ -32,7 +33,7 @@
import java.util.stream.Collectors;


public class GrpcPaymentAccountsService extends PaymentAccountsGrpc.PaymentAccountsImplBase {
class GrpcPaymentAccountsService extends PaymentAccountsGrpc.PaymentAccountsImplBase {

private final CoreApi coreApi;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.daemon.grpc;

import bisq.core.api.CoreApi;
import bisq.core.trade.statistics.TradeStatistics2;

import bisq.common.config.Config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.daemon.grpc;

import bisq.core.grpc.model.AddressBalanceInfo;
import bisq.core.api.CoreApi;
import bisq.core.api.model.AddressBalanceInfo;

import bisq.proto.grpc.GetAddressBalanceReply;
import bisq.proto.grpc.GetAddressBalanceRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.core.grpc;
package bisq.daemon.grpc;

import io.grpc.Metadata;
import io.grpc.ServerCall;
Expand Down

0 comments on commit 10215b8

Please sign in to comment.