From 24fa281ab9b952cf30fe18511e7b18f0d91f6f1d Mon Sep 17 00:00:00 2001 From: Brian Faust Date: Tue, 18 Jun 2019 05:41:22 +0300 Subject: [PATCH] refactor(core-wallet-api): always keep the Wallet API enabled (#2715) --- packages/core-wallet-api/src/defaults.ts | 1 - packages/core-wallet-api/src/plugin.ts | 13 ++----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/core-wallet-api/src/defaults.ts b/packages/core-wallet-api/src/defaults.ts index 4e1a6cfaef..a091cadb92 100644 --- a/packages/core-wallet-api/src/defaults.ts +++ b/packages/core-wallet-api/src/defaults.ts @@ -1,5 +1,4 @@ export const defaults = { - enabled: !process.env.CORE_WALLET_API_DISABLED, server: { host: process.env.CORE_WALLET_API_HOST || "0.0.0.0", port: process.env.CORE_WALLET_API_PORT || 4040, diff --git a/packages/core-wallet-api/src/plugin.ts b/packages/core-wallet-api/src/plugin.ts index b662d83478..787fc5ddfa 100644 --- a/packages/core-wallet-api/src/plugin.ts +++ b/packages/core-wallet-api/src/plugin.ts @@ -1,4 +1,4 @@ -import { Container, Logger } from "@arkecosystem/core-interfaces"; +import { Container } from "@arkecosystem/core-interfaces"; import { defaults } from "./defaults"; import { startServer } from "./server"; @@ -7,18 +7,9 @@ export const plugin: Container.IPluginDescriptor = { defaults, alias: "wallet-api", async register(container: Container.IContainer, options) { - if (!options.enabled) { - container.resolvePlugin("logger").info("Wallet API is disabled"); - return undefined; - } - - container.resolvePlugin("logger").info("Starting Wallet API"); return startServer(options.server); }, async deregister(container: Container.IContainer, options) { - if (options.enabled) { - container.resolvePlugin("logger").info("Stopping Wallet API"); - await container.resolvePlugin("wallet-api").stop(); - } + await container.resolvePlugin("wallet-api").stop(); }, };