Skip to content

Commit 1fa4f1e

Browse files
author
francois branciard
committed
update migration for testnets
1 parent db90dd5 commit 1fa4f1e

File tree

3 files changed

+100
-34
lines changed

3 files changed

+100
-34
lines changed

README.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -492,37 +492,36 @@ or
492492

493493

494494
```
495-
coverage : 10/04/2018
495+
coverage : 12/04/2018
496496
497-
180 passing (12m)
498-
1 pending
497+
180 passing (13m)
498+
1 pending
499499
500500
-----------------------------|----------|----------|----------|----------|----------------|
501501
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
502502
-----------------------------|----------|----------|----------|----------|----------------|
503-
contracts/ | 100 | 75.16 | 100 | 100 | |
504-
App.sol | 100 | 50 | 100 | 100 | |
505-
AppHub.sol | 100 | 100 | 100 | 100 | |
506-
Dataset.sol | 100 | 50 | 100 | 100 | |
507-
DatasetHub.sol | 100 | 100 | 100 | 100 | |
508-
IexecAPI.sol | 100 | 50 | 100 | 100 | |
509-
IexecCallbackInterface.sol | 100 | 100 | 100 | 100 | |
510-
IexecHub.sol | 100 | 69.83 | 100 | 100 | |
511-
IexecHubAccessor.sol | 100 | 75 | 100 | 100 | |
512-
IexecHubInterface.sol | 100 | 100 | 100 | 100 | |
513-
IexecLib.sol | 100 | 100 | 100 | 100 | |
514-
Marketplace.sol | 100 | 88.89 | 100 | 100 | |
515-
MarketplaceAccessor.sol | 100 | 50 | 100 | 100 | |
516-
MarketplaceInterface.sol | 100 | 100 | 100 | 100 | |
517-
OwnableOZ.sol | 100 | 75 | 100 | 100 | |
518-
SafeMathOZ.sol | 100 | 75 | 100 | 100 | |
519-
TestSha.sol | 100 | 100 | 100 | 100 | |
520-
WorkOrder.sol | 100 | 62.5 | 100 | 100 | |
521-
WorkerPool.sol | 100 | 82.69 | 100 | 100 | |
522-
WorkerPoolHub.sol | 100 | 75 | 100 | 100 | |
503+
contracts/ | 100 | 75.16 | 100 | 100 | |
504+
App.sol | 100 | 50 | 100 | 100 | |
505+
AppHub.sol | 100 | 100 | 100 | 100 | |
506+
Dataset.sol | 100 | 50 | 100 | 100 | |
507+
DatasetHub.sol | 100 | 100 | 100 | 100 | |
508+
IexecAPI.sol | 100 | 50 | 100 | 100 | |
509+
IexecCallbackInterface.sol | 100 | 100 | 100 | 100 | |
510+
IexecHub.sol | 100 | 69.83 | 100 | 100 | |
511+
IexecHubAccessor.sol | 100 | 75 | 100 | 100 | |
512+
IexecHubInterface.sol | 100 | 100 | 100 | 100 | |
513+
IexecLib.sol | 100 | 100 | 100 | 100 | |
514+
Marketplace.sol | 100 | 88.89 | 100 | 100 | |
515+
MarketplaceAccessor.sol | 100 | 50 | 100 | 100 | |
516+
MarketplaceInterface.sol | 100 | 100 | 100 | 100 | |
517+
OwnableOZ.sol | 100 | 75 | 100 | 100 | |
518+
SafeMathOZ.sol | 100 | 75 | 100 | 100 | |
519+
TestSha.sol | 100 | 100 | 100 | 100 | |
520+
WorkOrder.sol | 100 | 62.5 | 100 | 100 | |
521+
WorkerPool.sol | 100 | 82.69 | 100 | 100 | |
522+
WorkerPoolHub.sol | 100 | 75 | 100 | 100 | |
523523
-----------------------------|----------|----------|----------|----------|----------------|
524524
All files | 100 | 75.16 | 100 | 100 | |
525525
-----------------------------|----------|----------|----------|----------|----------------|
526-
```
527526
528527
## Oyente analyse see [here](./oyente)

migrations/2_deploy_contracts.js

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,15 @@ module.exports = function(deployer) {
119119
//mainnet = '0x607F4C5BB672230e8672085532f7e901544a7375'
120120
121121
module.exports = function(deployer) {
122+
let aRLCInstance;
122123
let aWorkerPoolHubInstance;
123124
let aAppHubInstance;
124125
let aDatasetHubInstance;
125-
let aTaskRequestHubInstance;
126126
let aIexecHub;
127+
let aMarketplaceInstance;
128+
let creator;
129+
aRLCInstance='0xc57538846ec405ea25deb00e0f9b29a432d53507';
130+
127131
return deployer.deploy(WorkerPoolHub)
128132
.then(() => WorkerPoolHub.deployed())
129133
.then(instance => {
@@ -141,13 +145,7 @@ module.exports = function(deployer) {
141145
.then(instance => {
142146
aDatasetHubInstance = instance;
143147
console.log("DatasetHub deployed at address: " + instance.address);
144-
return deployer.deploy(TaskRequestHub);
145-
})
146-
.then(() => TaskRequestHub.deployed())
147-
.then(instance => {
148-
aTaskRequestHubInstance = instance;
149-
console.log("TaskRequestHub deployed at address: " + instance.address);
150-
return deployer.deploy(IexecHub, '0x7314dc4d7794b5e7894212ca1556ae8e3de58621', aWorkerPoolHubInstance.address, aAppHubInstance.address, aDatasetHubInstance.address, aTaskRequestHubInstance.address);
148+
return deployer.deploy(IexecHub, aRLCInstance, aWorkerPoolHubInstance.address, aAppHubInstance.address, aDatasetHubInstance.address);
151149
})
152150
.then(() => IexecHub.deployed())
153151
.then(instance => {
@@ -165,9 +163,36 @@ module.exports = function(deployer) {
165163
})
166164
.then(() => {
167165
console.log("transferOwnership of DatasetHub to IexecHub");
168-
return aTaskRequestHubInstance.transferOwnership(aIexecHub.address);
166+
return deployer.deploy(Marketplace, aIexecHub.address);
167+
})
168+
.then(() => Marketplace.deployed())
169+
.then(instance => {
170+
aMarketplaceInstance = instance;
171+
console.log("Marketplace deployed at address: " + instance.address);
172+
return aIexecHub.attachMarketplace(instance.address);
169173
})
170-
.then(() => console.log("transferOwnership of TaskRequestHub to IexecHub"));
174+
.then(() => {
175+
console.log("attach Marketplace to IexecHub done");
176+
return aIexecHub.setCategoriesCreator(creator);
177+
})
178+
.then(() => {
179+
console.log("setCategoriesCreator to "+creator);
180+
return readFileAsync("./config/categories.json");
181+
})
182+
.then(categories => {
183+
var categoriesConfigFileJson = JSON.parse(categories);
184+
catagoriesPromises = [];
185+
for(var i = 0; i < categoriesConfigFileJson.categories.length; i++) {
186+
console.log("create category : "+categoriesConfigFileJson.categories[i].name);
187+
catagoriesPromises.push(aIexecHub.createCategory(categoriesConfigFileJson.categories[i].name,JSON.stringify(categoriesConfigFileJson.categories[i].description),categoriesConfigFileJson.categories[i].workClockTimeRef));
188+
}
189+
return Promise.all(catagoriesPromises);
190+
})
191+
.then(categoriesCreated => {
192+
return aIexecHub.m_categoriesCount.call()
193+
})
194+
.then(m_categoriesCount => console.log("m_categoriesCount is now: "+m_categoriesCount))
195+
;
171196
};
172197
173198
**/

truffle-hdwallet.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
var HDWalletProvider = require("truffle-hdwallet-provider");
3+
var mnemonic = "12 words";
4+
5+
6+
module.exports = {
7+
networks: {
8+
ropsten: {
9+
provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/berv5GTB5cSdOJPPnqOq"),
10+
network_id: "3",
11+
gas: 4400000,
12+
gasPrice: 22000000000,
13+
},
14+
rinkeby: {
15+
provider: new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/berv5GTB5cSdOJPPnqOq"),
16+
network_id: "4",
17+
gas: 4400000,
18+
gasPrice: 22000000000,
19+
},
20+
kovan: {
21+
provider: new HDWalletProvider(mnemonic, "https://kovan.infura.io/berv5GTB5cSdOJPPnqOq"),
22+
network_id: "42",
23+
gas: 4400000,
24+
gasPrice: 22000000000,
25+
},/*
26+
mainnet: {
27+
provider: new HDWalletProvider(mnemonic, "https://mainnet.infura.io/berv5GTB5cSdOJPPnqOq"),
28+
network_id: "1",
29+
gas: 4400000,
30+
gasPrice: 22000000000,
31+
},*/
32+
},
33+
solc: {
34+
optimizer: {
35+
enabled: true,
36+
runs: 200
37+
}
38+
},
39+
mocha: {
40+
enableTimeouts: false
41+
}
42+
};

0 commit comments

Comments
 (0)