Merge branch 'develop' into bug_fix/change-warn-path-depth-to-length

This commit is contained in:
Iuri Matias 2018-05-27 08:05:51 -04:00 committed by GitHub
commit 2608eed19b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 40 additions and 15 deletions

View File

@ -54,6 +54,8 @@ Config.prototype.loadConfigFiles = function(options) {
this.loadWebServerConfigFile();
this.loadChainTrackerFile();
this.loadPluginContractFiles();
this._updateBlockchainCors();
};
Config.prototype.reloadConfig = function() {
@ -66,6 +68,27 @@ Config.prototype.reloadConfig = function() {
this.loadContractsConfigFile();
this.loadExternalContractsFiles();
this.loadChainTrackerFile();
this._updateBlockchainCors();
};
Config.prototype._updateBlockchainCors = function(){
let blockchainConfig = this.blockchainConfig;
let storageConfig = this.storageConfig;
let webServerConfig = this.webServerConfig;
let cors = '';
if(webServerConfig && webServerConfig.enabled) {
let webServerPort = webServerConfig.port ? `:${webServerConfig.port}` : '';
if(webServerConfig.host) cors = `http://${webServerConfig.host}${webServerPort}`;
}
if(storageConfig && storageConfig.enabled) {
let storagePort = storageConfig.port ? `:${storageConfig.port}` : '';
if(storageConfig.host) cors += `${cors.length ? ',' : ''}${storageConfig.protocol || 'http'}://${storageConfig.host}${storagePort}`;
}
if(blockchainConfig.rpcCorsDomain === 'auto' && cors.length) blockchainConfig.rpcCorsDomain = cors;
if(blockchainConfig.wsOrigins === 'auto' && cors.length) blockchainConfig.wsOrigins = cors;
};
Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, enabledByDefault) {

View File

@ -132,5 +132,11 @@
"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.",
"DApp path length is too long: ": "DApp path length is too long: ",
"WARNING! DApp path length is too long: ": "WARNING! DApp path length is too long: ",
"This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.": "This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less."
"This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.": "This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.",
"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",
"%s is not installed on your machine": "%s is not installed on your machine",
"You can install it by visiting: %s": "You can install it by visiting: %s"
}

View File

@ -49,19 +49,7 @@ class Embark {
blockchain(env, client) {
this.context = [constants.contexts.blockchain];
let blockchainConfig = this.config.blockchainConfig;
let storageConfig = this.config.storageConfig;
let webServerConfig = this.config.webServerConfig;
if(blockchainConfig.rpcCorsDomain === 'auto') {
if(webServerConfig) blockchainConfig.rpcCorsDomain = `http://${webServerConfig.host}:${webServerConfig.port}`;
if(storageConfig) blockchainConfig.rpcCorsDomain += `${blockchainConfig.rpcCorsDomain.length ? ',' : ''}${storageConfig.protocol}://${storageConfig.host}:${storageConfig.port}`;
}
if(blockchainConfig.wsOrigins === 'auto') {
if(webServerConfig) blockchainConfig.wsOrigins = `http://${webServerConfig.host}:${webServerConfig.port}`;
if(storageConfig) blockchainConfig.wsOrigins += `${blockchainConfig.wsOrigins.length ? ',' : ''}${storageConfig.protocol}://${storageConfig.host}:${storageConfig.port}`;
}
return require('./cmds/blockchain/blockchain.js')(blockchainConfig, client, env, this.isDev(env)).run();
return require('./cmds/blockchain/blockchain.js')(this.config.blockchainConfig, client, env, this.isDev(env)).run();
}
simulator(options) {

View File

@ -35,7 +35,15 @@ class Vyper {
if (!contractFiles || !contractFiles.length) {
return cb();
}
const vyper = shelljs.which('vyper');
if (!vyper) {
self.logger.warn(__('%s is not installed on your machine', 'Vyper'));
self.logger.info(__('You can install it by visiting: %s', 'https://vyper.readthedocs.io/en/latest/installing-vyper.html'));
return cb();
}
self.logger.info(__("compiling Vyper contracts") + "...");
const compiled_object = {};
async.each(contractFiles,
function (file, fileCb) {

View File

@ -11,7 +11,7 @@
"enabled": true,
"provider": "swarm",
"host": "swarm-gateways.net",
"port": 80,
"port": false,
"getUrl": "http://swarm-gateways.net/bzzr:/"
},
"livenet": {