-
Notifications
You must be signed in to change notification settings - Fork 1
/
ens-deploy.txt
215 lines (166 loc) · 6.23 KB
/
ens-deploy.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
https://github.com/ensdomains/ens
https://github.com/ensdomains/resolvers
Deploy ENS and FIFSRegistrar to the private network, the deployment process is defined at here:
$ truffle migrate --network dev.fifs
alternatively, deploy the HashRegistrar:
$ truffle migrate --network dev.auction
git clone https://github.com/ensdomains/ens.git
[liwei@osdnode94 ens]$ truffle migrate --network dev.fifs --reset
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Warning: Both truffle-config.js and truffle.js were found. Using truffle-config.js.
Starting migrations...
======================
> Network name: 'dev.fifs'
> Network id: 1515
> Block gas limit: 0x7a1200
1_initial_migration.js
======================
Replacing 'Migrations'
----------------------
> transaction hash: 0x121960b2b7ac2e91feea4843e331debca0bf73f1e8ba291107af1a34cfa93120
> Blocks: 1 Seconds: 4
> contract address: 0x390539769D6AF32382dfCC1f6Dac93e30305C672
> block number: 353290
> block timestamp: 1558006485
> account: 0xFf9D40c2d790B1737729CD3a4b58C08aEad2E7e1
> balance: 4.986722319998639555
> gas used: 284908
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.00569816 ETH
> Saving migration to chain.
> Saving artifacts
-------------------------------------
> Total cost: 0.00569816 ETH
2_deploy_contracts.js
=====================
Deploying 'ENSRegistry'
-----------------------
> transaction hash: 0x90844e20b52b84a0079358970c96e2f9ddfbff5989e674d5c0b6bff17fceb86d
> Blocks: 1 Seconds: 4
> contract address: 0xed055F160D056EB858A4e510C31B9328475dc205
> block number: 353292
> block timestamp: 1558006495
> account: 0xFf9D40c2d790B1737729CD3a4b58C08aEad2E7e1
> balance: 4.972209019998639555
> gas used: 683631
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.01367262 ETH
Deploying 'FIFSRegistrar'
var tld = 'eth';
if (network === 'dev.fifs') {
deployFIFSRegistrar(deployer, tld);
}
TLD is 'eth'
if define a new top level domain, for example '.com',you should do
deployFIFSRegistrar(deployer, 'com');
/**
* Deploy the ENS and FIFSRegistrar
*
* @param {Object} deployer truffle deployer helper
* @param {string} tld tld which the FIFS registrar takes charge of
*/
function deployFIFSRegistrar(deployer, tld) {
var rootNode = getRootNodeFromTLD(tld);
// Deploy the ENS first
deployer.deploy(ENS)
.then(() => {
// Deploy the FIFSRegistrar and bind it with ENS
return deployer.deploy(FIFSRegistrar, ENS.address, rootNode.namehash);
})
.then(function() {
// Transfer the owner of the `rootNode` to the FIFSRegistrar
return ENS.at(ENS.address).then((c) => c.setSubnodeOwner('0x0', rootNode.sha3, FIFSRegistrar.address));
});
}
-------------------------
> transaction hash: 0x3c0e7bb80c068b45749479be773aa371ec290ea9a443d19042dd59a35f2b5aa8
> Blocks: 0 Seconds: 4
> contract address: 0x99dEb8530B419d62c3fcF1bD5eF691C8c96bC5FF
> block number: 353293
> block timestamp: 1558006500
> account: 0xFf9D40c2d790B1737729CD3a4b58C08aEad2E7e1
> balance: 4.965866999998639555
> gas used: 317101
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.00634202 ETH
> Saving migration to chain.
> Saving artifacts
-------------------------------------
> Total cost: 0.02001464 ETH
Summary
=======
> Total deployments: 3
> Final cost: 0.0257128 ETH
=======
> Total deployments: 1
> Final cost: 0.00569816 ETH
# Deploy resolver
var PublicResolver = artifacts.require("./PublicResolver.sol");
const ensaddress = '0xed055F160D056EB858A4e510C31B9328475dc205';
async function deployResolver(deployer){
const publicResolver = await PublicResolver.new(ensaddress);
}
module.exports = function(deployer) {
// deployer.deploy(Migrations);
deployer.deploy(PublicResolver,ensaddress);
deployResolver(deployer);
};
[liwei@osdnode94 resolvers]$ truffle migrate --network local --reset
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'local'
> Network id: 1515
> Block gas limit: 0x7a1200
1_initial_migration.js
======================
Replacing 'PublicResolver'
--------------------------
> transaction hash: 0x6ae5b639ec04715668ffb43db5d99e44ad1837935c63dd383d375b6c598edf8b
> Blocks: 1 Seconds: 4
> contract address: 0x0Fa28CeE73dCBcBD436B6F2FA5056c2D1A98f756
> block number: 354942
> block timestamp: 1558014745
> account: 0xFf9D40c2d790B1737729CD3a4b58C08aEad2E7e1
> balance: 4.765954559998639555
> gas used: 2408912
> gas price: 20 gwei
> value sent: 0 ETH
> total cost: 0.04817824 ETH
> Saving artifacts
-------------------------------------
> Total cost: 0.04817824 ETH
Summary
=======
> Total deployments: 1
> Final cost: 0.04817824 ETH
Summary
=======
> Total deployments: 1
> Final cost: 0.04817824 ETH
低版本的
cd node_modules/@ensdomains/ens
npm install [email protected] -g
liweideMacBook-Pro:ens liwei$ truffle migrate --network dev.fifs
Using network 'dev.fifs'.
Running migration: 2_deploy_contracts.js
Deploying ENSRegistry...
... 0x59c16c053f4f4587cb34d6a6002c043b481c3c46fb1e5f0c8ccad0eba81f4987
ENSRegistry: 0x22fb31e04f0d93d261a87f808d2f80d52c241fc7
Deploying FIFSRegistrar...
... 0x9ca461ddb3adb81bfd6a9348c5ffae544ace63efce4031f9386e326e5157af4c
FIFSRegistrar: 0xbf0444a80b739991be4390ce385cbeb83a41cf9a
Saving successful migration to network...
... 0x7eec299022e037044c89c82c19e8a381a3c036b6a64275555af93385af173ae7
... 0x9f730a165d3472e5bc8f632a1830fef367be831b4ca121677a64599b257d365d
Saving artifacts...