From 65175a7f4fea2127539518ba9fdf4ed646c0459f Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Sat, 21 Dec 2019 10:30:15 +0100 Subject: [PATCH] Remove --desktopWith{Grpc|Http}Api options for now The previous commit introduces the BisqGrpcServer as a proof of concept, but it is not yet ready for production use. This commit removes the `--desktopWithGrpcApi` option that starts the gRPC server until such time that it is production-ready. This change also removes the `--desktopWithHttpApi` option for starting an HTTP API server. The option has been in place for some time, but it was 'false advertising' in the sense that nothing actually happened if the user specified it, because there is in fact no HTTP API implementation to be started. Note that when the gRPC API option is reintroduced, it will be renamed to `--rpcserver` or similar, following the convention in Bitcoin Core. --- .../java/bisq/core/app/AppOptionKeys.java | 2 -- .../java/bisq/core/app/BisqEnvironment.java | 6 ----- .../java/bisq/core/app/BisqExecutable.java | 10 ------- .../java/bisq/desktop/app/BisqAppMain.java | 26 ++----------------- 4 files changed, 2 insertions(+), 42 deletions(-) diff --git a/core/src/main/java/bisq/core/app/AppOptionKeys.java b/core/src/main/java/bisq/core/app/AppOptionKeys.java index 6c44f7d4f81..b18679cbf0b 100644 --- a/core/src/main/java/bisq/core/app/AppOptionKeys.java +++ b/core/src/main/java/bisq/core/app/AppOptionKeys.java @@ -18,8 +18,6 @@ package bisq.core.app; public class AppOptionKeys { - public static final String DESKTOP_WITH_HTTP_API = "desktopWithHttpApi"; - public static final String DESKTOP_WITH_GRPC_API = "desktopWithGrpcApi"; public static final String APP_NAME_KEY = "appName"; public static final String USER_DATA_DIR_KEY = "userDataDir"; public static final String APP_DATA_DIR_KEY = "appDataDir"; diff --git a/core/src/main/java/bisq/core/app/BisqEnvironment.java b/core/src/main/java/bisq/core/app/BisqEnvironment.java index ddebb407ae1..de8decf27dd 100644 --- a/core/src/main/java/bisq/core/app/BisqEnvironment.java +++ b/core/src/main/java/bisq/core/app/BisqEnvironment.java @@ -186,8 +186,6 @@ public static boolean isDaoActivated(Environment environment) { @Setter protected boolean isBitcoinLocalhostNodeRunning; @Getter - protected String desktopWithHttpApi, desktopWithGrpcApi; - @Getter protected List bannedSeedNodes, bannedBtcNodes, bannedPriceRelayNodes; protected final String btcNodes, seedNodes, ignoreDevMsg, useDevPrivilegeKeys, useDevMode, useTorForBtc, rpcUser, rpcPassword, @@ -219,8 +217,6 @@ public BisqEnvironment(PropertySource commandLineProperties) { appDataDir = getProperty(commandLineProperties, AppOptionKeys.APP_DATA_DIR_KEY, appDataDir(userDataDir, appName)); staticAppDataDir = appDataDir; - desktopWithHttpApi = getProperty(commandLineProperties, AppOptionKeys.DESKTOP_WITH_HTTP_API, "false"); - desktopWithGrpcApi = getProperty(commandLineProperties, AppOptionKeys.DESKTOP_WITH_GRPC_API, "false"); ignoreDevMsg = getProperty(commandLineProperties, AppOptionKeys.IGNORE_DEV_MSG_KEY, ""); useDevPrivilegeKeys = getProperty(commandLineProperties, AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, ""); referralId = getProperty(commandLineProperties, AppOptionKeys.REFERRAL_ID, ""); @@ -398,8 +394,6 @@ private PropertySource defaultProperties() { setProperty(NetworkOptionKeys.SEND_MSG_THROTTLE_SLEEP, sendMsgThrottleSleep); setProperty(AppOptionKeys.APP_DATA_DIR_KEY, appDataDir); - setProperty(AppOptionKeys.DESKTOP_WITH_HTTP_API, desktopWithHttpApi); - setProperty(AppOptionKeys.DESKTOP_WITH_GRPC_API, desktopWithGrpcApi); setProperty(AppOptionKeys.IGNORE_DEV_MSG_KEY, ignoreDevMsg); setProperty(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, useDevPrivilegeKeys); setProperty(AppOptionKeys.REFERRAL_ID, referralId); diff --git a/core/src/main/java/bisq/core/app/BisqExecutable.java b/core/src/main/java/bisq/core/app/BisqExecutable.java index 6a8be7955e4..8dd905bc06e 100644 --- a/core/src/main/java/bisq/core/app/BisqExecutable.java +++ b/core/src/main/java/bisq/core/app/BisqExecutable.java @@ -446,16 +446,6 @@ protected void customizeOptionParsing(OptionParser parser) { .withRequiredArg() .ofType(boolean.class); - parser.accepts(AppOptionKeys.DESKTOP_WITH_HTTP_API, - format("If set to true Bisq Desktop starts with Http API (default: %s)", "false")) - .withRequiredArg() - .ofType(boolean.class); - - parser.accepts(AppOptionKeys.DESKTOP_WITH_GRPC_API, - format("If set to true Bisq Desktop starts with gRPC API (default: %s)", "false")) - .withRequiredArg() - .ofType(boolean.class); - parser.accepts(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS, format("If that is true all the privileged features which requires a private key " + "to enable it are overridden by a dev key pair (This is for developers only!) (default: %s)", "false")) diff --git a/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java b/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java index cccaf5a63b4..7f63a3ef696 100644 --- a/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java +++ b/desktop/src/main/java/bisq/desktop/app/BisqAppMain.java @@ -21,7 +21,6 @@ import bisq.desktop.common.view.guice.InjectorViewFactory; import bisq.desktop.setup.DesktopPersistedDataHost; -import bisq.core.CoreApi; import bisq.core.app.BisqExecutable; import bisq.common.UserThread; @@ -37,12 +36,6 @@ import lombok.extern.slf4j.Slf4j; -import javax.annotation.Nullable; - - - -import bisq.grpc.BisqGrpcServer; - @Slf4j public class BisqAppMain extends BisqExecutable { private BisqApp application; @@ -51,11 +44,6 @@ public BisqAppMain() { super("Bisq Desktop", "bisq-desktop", Version.VERSION); } - /* @Nullable - private BisqHttpApiServer bisqHttpApiServer;*/ - @Nullable - private BisqGrpcServer bisqGrpcServer; - public static void main(String[] args) throws Exception { if (BisqExecutable.setupInitialOptionParser(args)) { // For some reason the JavaFX launch process results in us losing the thread context class loader: reset it. @@ -142,21 +130,11 @@ protected void startApplication() { protected void onApplicationStarted() { super.onApplicationStarted(); - /* if (runWithHttpApi()) { - bisqHttpApiServer = new BisqHttpApiServer(); - }*/ - + /* if (runWithGrpcApi()) { CoreApi coreApi = injector.getInstance(CoreApi.class); bisqGrpcServer = new BisqGrpcServer(coreApi); } - } - - private boolean runWithHttpApi() { - return bisqEnvironment.getDesktopWithHttpApi().toLowerCase().equals("true"); - } - - private boolean runWithGrpcApi() { - return bisqEnvironment.getDesktopWithGrpcApi().toLowerCase().equals("true"); + */ } }