starting to create registration and some changes to the deployment

Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
VoR0220 2018-06-15 12:32:48 -05:00 committed by Iuri Matias
parent c872c36de8
commit e3e9d2c962

View File

@ -251,3 +251,26 @@ __embarkENS.isAvailable = function () {
__embarkENS.register = function () {
return new Error("Not available with ENS");
};
__embarkENS.register = function (name, options) {
const self = this;
if (self.ens === undefined) return;
if (options.livenet) {
return;
}
let node = namehash.hash(name);
return self.ens.methods.owner(node).call().then((owner) => {
if (owner !== "0x" || owner !== undefined) {
console.warn("name has already been claimed, see owner: ", owner);
return;
}
return self.ens.methods.setSubnodeOwner(node, );
}).then((addr) => {
return addr;
}).catch(err => err);
}