attempt at deploying on dev net

Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
VoR0220 2018-06-15 10:23:55 -05:00 committed by Iuri Matias
parent cbc0b1b9fd
commit dfd496ed94
2 changed files with 41 additions and 91 deletions

View File

@ -3,96 +3,7 @@ import namehash from 'eth-ens-namehash';
/*global web3, EmbarkJS*/
let __embarkENS = {};
// registry interface for later
__embarkENS.registryInterface = [
{
"constant": true,
"inputs": [
{
"name": "node",
"type": "bytes32"
}
],
"name": "resolver",
"outputs": [
{
"name": "",
"type": "address"
}
],
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "node",
"type": "bytes32"
}
],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "node",
"type": "bytes32"
},
{
"name": "resolver",
"type": "address"
}
],
"name": "setResolver",
"outputs": [],
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "node",
"type": "bytes32"
},
{
"name": "label",
"type": "bytes32"
},
{
"name": "owner",
"type": "address"
}
],
"name": "setSubnodeOwner",
"outputs": [],
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "node",
"type": "bytes32"
},
{
"name": "owner",
"type": "address"
}
],
"name": "setOwner",
"outputs": [],
"type": "function"
}
];
// resolver interface
__embarkENS.resolverInterface = [
{
"constant": true,

View File

@ -1,3 +1,4 @@
/*global web3*/
const fs = require('../../core/fs.js');
const utils = require('../../utils/utils.js');
@ -7,6 +8,8 @@ class ENS {
this.events = embark.events;
this.namesConfig = embark.config.namesystemConfig;
this.embark = embark;
this.ensRegistry = null;
this.ensResolver = null;
this.addENSToEmbarkJS();
this.addSetProvider();
@ -23,6 +26,7 @@ class ENS {
return;
}
// get namehash, import it into file
self.events.request("version:get:eth-ens-namehash", function(EnsNamehashVersion) {
let currentEnsNamehashVersion = require('../../../package.json').dependencies["eth-ens-namehash"];
if (EnsNamehashVersion !== currentEnsNamehashVersion) {
@ -39,8 +43,43 @@ class ENS {
this.embark.addCodeToEmbarkJS(code);
}
configureENSRegistry() {
const self = this;
self.embark.addContractFile('./contracts/ENSRegistry.sol');
self.embark.registerContractConfiguration({
"default": {
"gas": "auto",
"ENSRegistry": {
"deploy": true,
}
},
"ropsten": {
"ENSRegistry": {
"address": "0x112234455c3a32fd11230c42e7bccd4a84e02010"
}
},
"rinkeby": {
"ENSRegistry": {
"address": "0xe7410170f87102DF0055eB195163A03B7F2Bff4A"
}
},
"mainnet": {
"ENSRegistry": {
"address": "0x314159265dd8dbb310642f98f50c066173c1259b"
}
}
});
self.events.on("deploy:contract:deployed", (contract) => {
if (contract.className === "ENSRegistry") {
return web3.eth.Contract(contract.abiDefinition, contract.address);
}
})
}
addSetProvider() {
let config = JSON.stringify({});
const self = this;
let config = JSON.stringify(self.configureENSRegistry());
let code = "\nEmbarkJS.Names.setProvider('ens'," + config + ");";