bugfix(@embark/embark): fix default values so choosing different environment doesn't cause hang (#1939)

This commit is contained in:
Iuri Matias 2019-10-01 14:18:10 -04:00 committed by GitHub
parent 17817fc3ec
commit eb23acb0f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -533,7 +533,7 @@ Config.prototype.loadCommunicationConfigFile = function() {
"available_providers": ["whisper"], "available_providers": ["whisper"],
"connection": { "connection": {
"host": defaultHost, "host": defaultHost,
"port": 8546, "port": 8557,
"type": "ws" "type": "ws"
} }
} }

View File

@ -4,6 +4,9 @@ const constants = require('embark-core/constants');
export function getBlockchainDefaults(env) { export function getBlockchainDefaults(env) {
const defaults = { const defaults = {
clientConfig: {
miningMode: 'dev' // Mode in which the node mines. Options: dev, auto, always, off
},
enabled: true, enabled: true,
client: constants.blockchain.clients.geth, client: constants.blockchain.clients.geth,
proxy: true, proxy: true,
@ -46,6 +49,7 @@ export function getContractDefaults(embarkConfigVersions) {
"versions": versions, "versions": versions,
"dappConnection": [ "dappConnection": [
"$WEB3", "$WEB3",
"ws://localhost:8546",
"localhost:8545" "localhost:8545"
], ],
"dappAutoEnable": true, "dappAutoEnable": true,

View File

@ -146,6 +146,10 @@ class ENS {
async registerConfigDomains(config, cb) { async registerConfigDomains(config, cb) {
const defaultAccount = await this.web3DefaultAccount; const defaultAccount = await this.web3DefaultAccount;
if (!this.config.namesystemConfig.register) {
return cb();
}
async.each(Object.keys(this.config.namesystemConfig.register.subdomains), (subDomainName, eachCb) => { async.each(Object.keys(this.config.namesystemConfig.register.subdomains), (subDomainName, eachCb) => {
const address = this.config.namesystemConfig.register.subdomains[subDomainName]; const address = this.config.namesystemConfig.register.subdomains[subDomainName];
const directivesRegExp = new RegExp(/\$(\w+\[?\d?\]?)/g); const directivesRegExp = new RegExp(/\$(\w+\[?\d?\]?)/g);
@ -165,6 +169,10 @@ class ENS {
const defaultAccount = await this.web3DefaultAccount; const defaultAccount = await this.web3DefaultAccount;
if (!this.config.namesystemConfig.register) {
return cb();
}
await Promise.all(Object.keys(this.config.namesystemConfig.register.subdomains).map((subDomainName) => { await Promise.all(Object.keys(this.config.namesystemConfig.register.subdomains).map((subDomainName) => {
return new Promise(async (resolve, _reject) => { return new Promise(async (resolve, _reject) => {
const address = this.config.namesystemConfig.register.subdomains[subDomainName]; const address = this.config.namesystemConfig.register.subdomains[subDomainName];