From 7aa44c7fe363857b298cf4def3de47c3af1fe35c Mon Sep 17 00:00:00 2001 From: emizzle Date: Thu, 31 May 2018 13:19:25 +1000 Subject: [PATCH] Added improvements to storage config --- lib/core/config.js | 3 ++- lib/core/engine.js | 13 ------------- lib/i18n/locales/en.json | 5 +++++ templates/boilerplate/config/storage.json | 17 ++++++++++++----- templates/demo/config/storage.json | 17 ++++++++++++----- templates/demo/test/simple_storage_spec.js | 2 +- 6 files changed, 32 insertions(+), 25 deletions(-) diff --git a/lib/core/config.js b/lib/core/config.js index 3110b42c5..e3c0c65c5 100644 --- a/lib/core/config.js +++ b/lib/core/config.js @@ -223,7 +223,8 @@ Config.prototype.loadStorageConfigFile = function() { "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/" - } + }, + "dappConnection": [{"provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/"}] } }; diff --git a/lib/core/engine.js b/lib/core/engine.js index 78b125198..6432d672c 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -268,19 +268,6 @@ class Engine { host: _options.host, port: _options.port }); - // this.registerModule('ipfs', { - // addCheck: this.servicesMonitor.addCheck.bind(this.servicesMonitor), - // storageConfig: this.config.storageConfig, - // host: _options.host, - // port: _options.port - // }); - // this.registerModule('swarm', { - // addCheck: this.servicesMonitor.addCheck.bind(this.servicesMonitor), - // storageConfig: this.config.storageConfig, - // // TODO: this should not be needed and should be deducted from the config instead - // // the eth provider is not necessary the same as the swarm one - // bzz: this.blockchain.web3.bzz - // }); } web3Service(options) { diff --git a/lib/i18n/locales/en.json b/lib/i18n/locales/en.json index a332cf35f..e5f864064 100644 --- a/lib/i18n/locales/en.json +++ b/lib/i18n/locales/en.json @@ -136,6 +136,11 @@ "deploying to swarm!": "deploying to swarm!", "adding %s to swarm": "adding %s to swarm", "successfully uploaded to swarm": "successfully uploaded to swarm", + "Cannot upload: {{platform}} node is not running on {{protocol}}://{{host}}{{port}}.": "Cannot upload: {{platform}} node is not running on {{protocol}}://{{host}}{{port}}.", + "Installing packages...": "Installing packages...", + "Next steps:": "Next steps:", + "open another console in the same directory and run": "open another console in the same directory and run", + "For more info go to http://embark.status.im": "For more info go to http://embark.status.im" "Cannot upload: {{platform}} node is not running on {{protocol}}://{{host}}{{port}}.": "Cannot upload: {{platform}} node is not running on {{protocol}}://{{host}}{{port}}." "This is known to cause issues with some applications, please consider reducing your DApp path's length to 66 characters or less.": "This is known to cause issues with some applications, please consider reducing your DApp path's length to 66 characters or less." "no contracts found": "no contracts found", diff --git a/templates/boilerplate/config/storage.json b/templates/boilerplate/config/storage.json index f1041e849..da1aa6b74 100644 --- a/templates/boilerplate/config/storage.json +++ b/templates/boilerplate/config/storage.json @@ -4,14 +4,21 @@ "ipfs_bin": "ipfs", "provider": "ipfs", "available_providers": ["ipfs"], - "host": "localhost", - "port": 5001 + "upload": { + "host": "localhost", + "port": 5001 + }, + "dappConnection": [ + {"provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/"} + ] }, "development": { "enabled": true, "provider": "ipfs", - "host": "localhost", - "port": 5001, - "getUrl": "http://localhost:8080/ipfs/" + "upload": { + "host": "localhost", + "port": 5001, + "getUrl": "http://localhost:8080/ipfs/" + } } } diff --git a/templates/demo/config/storage.json b/templates/demo/config/storage.json index f1041e849..da1aa6b74 100644 --- a/templates/demo/config/storage.json +++ b/templates/demo/config/storage.json @@ -4,14 +4,21 @@ "ipfs_bin": "ipfs", "provider": "ipfs", "available_providers": ["ipfs"], - "host": "localhost", - "port": 5001 + "upload": { + "host": "localhost", + "port": 5001 + }, + "dappConnection": [ + {"provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/"} + ] }, "development": { "enabled": true, "provider": "ipfs", - "host": "localhost", - "port": 5001, - "getUrl": "http://localhost:8080/ipfs/" + "upload": { + "host": "localhost", + "port": 5001, + "getUrl": "http://localhost:8080/ipfs/" + } } } diff --git a/templates/demo/test/simple_storage_spec.js b/templates/demo/test/simple_storage_spec.js index 53476a5bf..25855d70c 100644 --- a/templates/demo/test/simple_storage_spec.js +++ b/templates/demo/test/simple_storage_spec.js @@ -17,7 +17,7 @@ describe("SimpleStorage", function() { it("set storage value", async function() { await SimpleStorage.methods.set(150).send(); - let result = SimpleStorage.methods.get().call(); + let result = await SimpleStorage.methods.get().call(); assert.equal(result, 150); });