bare bones bulk registration example spec

Signed-off-by: VoR0220 <catalanor0220@gmail.com>

add registrars to system

Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
VoR0220 2018-06-20 14:14:06 -05:00 committed by Iuri Matias
parent cbe9a47662
commit 8425e9b69b
2 changed files with 20 additions and 3 deletions

View File

@ -281,7 +281,10 @@ Config.prototype.loadNameSystemConfigFile = function() {
"default": {
"available_providers": ["ens"],
"provider": "ens",
"enabled": true
"enabled": true,
"register": {
"rootDomain": "embark"
}
}
};

View File

@ -14,8 +14,6 @@ class ENS {
this.namesConfig = embark.config.namesystemConfig;
this.registration = this.namesConfig.register || {};
this.embark = embark;
this.ensRegistry = null;
this.ensResolver = null;
if (this.namesConfig === {} ||
this.namesConfig.enabled !== true ||
@ -312,6 +310,22 @@ class ENS {
}
}
configureRootRegistrar() {
const self = this;
let rootNode = namehash.hash(self.registration.rootDomain);
self.embark.registerContractConfiguration({
"default": {
"gas": "auto",
"FIFSRegistrar": {
"deploy": true,
"args": ["$ENSRegistry", rootNode],
"onDeploy": ["ENSRegistry.methods.setOwner(0, FIFSRegistrar.options.address).send()"]
}
}
});
self.embark.events.request("config:contractsFiles:add", self.embark.pathToFile('./contracts/FIFSRegistrar.sol'));
}
addSetProvider(config) {
let code = "\nEmbarkJS.Names.setProvider('ens'," + JSON.stringify(config) + ");";