diff --git a/lib/modules/ens/embarkjs.js b/lib/modules/ens/embarkjs.js index b9138322..4505876b 100644 --- a/lib/modules/ens/embarkjs.js +++ b/lib/modules/ens/embarkjs.js @@ -149,9 +149,10 @@ __embarkENS.registryAddresses = { __embarkENS.setProvider = function (config) { const self = this; const ERROR_MESSAGE = 'ENS is not available in this chain'; - EmbarkJS.onReady(() => { - self.registration = config.registration; + self.registration = config.registration; + self.env = config.env; + EmbarkJS.onReady(() => { web3.eth.net.getId() .then((id) => { const registryAddress = self.registryAddresses[id] || config.registryAddress; @@ -228,10 +229,12 @@ __embarkENS.lookup = function (address, callback) { __embarkENS.registerSubDomain = function (name, address, callback) { callback = callback || function () {}; + if (this.env !== 'development') { + return callback('Sub-domain registration is only available in development mode'); + } if (!this.registration || !this.registration.rootDomain) { return callback('No rootDomain is declared in config/namesystem.js (register.rootDomain). Unable to register a subdomain until then.'); } - if (!address || !web3.utils.isAddress(address)) { return callback('You need to specify a valid address for the subdomain'); } diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index ab661d5a..fd30baf2 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -40,6 +40,7 @@ class ENS { ], (err, results) => { // result[0] => ENSRegistry; result[1] => FIFSRegistrar; result[2] => FIFSRegistrar let config = { + env: self.env, registration: self.registration, registryAbi: results[0].abiDefinition, registryAddress: results[0].deployedAddress,