From c7eb5868b9e6809d077e520147e3ee16a4cfe31a Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Tue, 3 Sep 2019 17:56:12 +0200 Subject: [PATCH] fix(@embark/cmd_controller): ensure blockchain module is started before storage (#1821) This is crucial as the storage module tries to generate/eval artifacts that depend on a `web3` object inside the VM scope. The registration of that object can only be garuanteed when the `blockchain:started` event has been fired. This commit ensures these modules are not spinned up in parallel as we're running into race conditions. --- packages/embark/src/cmd/cmd_controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/embark/src/cmd/cmd_controller.js b/packages/embark/src/cmd/cmd_controller.js index 9047db8de..afd756abb 100644 --- a/packages/embark/src/cmd/cmd_controller.js +++ b/packages/embark/src/cmd/cmd_controller.js @@ -183,8 +183,8 @@ class EmbarkController { const plugin = engine.plugins.createPlugin('cmdcontrollerplugin', {}); plugin.registerActionForEvent("embark:engine:started", async (_params, cb) => { try { + await engine.events.request2("blockchain:node:start", engine.config.blockchainConfig); await Promise.all([ - engine.events.request2("blockchain:node:start", engine.config.blockchainConfig), engine.events.request2("storage:node:start", engine.config.storageConfig), engine.events.request2("communication:node:start", engine.config.communicationConfig), engine.events.request2("namesystem:node:start", engine.config.namesystemConfig)