Skip to content

Commit

Permalink
refactor(core-wallet-api): always keep the Wallet API enabled (#2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian authored Jun 18, 2019
1 parent 2ec6df4 commit 24fa281
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion packages/core-wallet-api/src/defaults.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
13 changes: 2 additions & 11 deletions packages/core-wallet-api/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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.ILogger>("logger").info("Wallet API is disabled");
return undefined;
}

container.resolvePlugin<Logger.ILogger>("logger").info("Starting Wallet API");
return startServer(options.server);
},
async deregister(container: Container.IContainer, options) {
if (options.enabled) {
container.resolvePlugin<Logger.ILogger>("logger").info("Stopping Wallet API");
await container.resolvePlugin("wallet-api").stop();
}
await container.resolvePlugin("wallet-api").stop();
},
};

0 comments on commit 24fa281

Please sign in to comment.