Skip to content

Commit

Permalink
update migration for testnets
Browse files Browse the repository at this point in the history
  • Loading branch information
francois branciard committed Apr 12, 2018
1 parent db90dd5 commit 1fa4f1e
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 34 deletions.
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,37 +492,36 @@ or


```
coverage : 10/04/2018
coverage : 12/04/2018
180 passing (12m)
1 pending
180 passing (13m)
1 pending
-----------------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-----------------------------|----------|----------|----------|----------|----------------|
contracts/ | 100 | 75.16 | 100 | 100 | |
App.sol | 100 | 50 | 100 | 100 | |
AppHub.sol | 100 | 100 | 100 | 100 | |
Dataset.sol | 100 | 50 | 100 | 100 | |
DatasetHub.sol | 100 | 100 | 100 | 100 | |
IexecAPI.sol | 100 | 50 | 100 | 100 | |
IexecCallbackInterface.sol | 100 | 100 | 100 | 100 | |
IexecHub.sol | 100 | 69.83 | 100 | 100 | |
IexecHubAccessor.sol | 100 | 75 | 100 | 100 | |
IexecHubInterface.sol | 100 | 100 | 100 | 100 | |
IexecLib.sol | 100 | 100 | 100 | 100 | |
Marketplace.sol | 100 | 88.89 | 100 | 100 | |
MarketplaceAccessor.sol | 100 | 50 | 100 | 100 | |
MarketplaceInterface.sol | 100 | 100 | 100 | 100 | |
OwnableOZ.sol | 100 | 75 | 100 | 100 | |
SafeMathOZ.sol | 100 | 75 | 100 | 100 | |
TestSha.sol | 100 | 100 | 100 | 100 | |
WorkOrder.sol | 100 | 62.5 | 100 | 100 | |
WorkerPool.sol | 100 | 82.69 | 100 | 100 | |
WorkerPoolHub.sol | 100 | 75 | 100 | 100 | |
contracts/ | 100 | 75.16 | 100 | 100 | |
App.sol | 100 | 50 | 100 | 100 | |
AppHub.sol | 100 | 100 | 100 | 100 | |
Dataset.sol | 100 | 50 | 100 | 100 | |
DatasetHub.sol | 100 | 100 | 100 | 100 | |
IexecAPI.sol | 100 | 50 | 100 | 100 | |
IexecCallbackInterface.sol | 100 | 100 | 100 | 100 | |
IexecHub.sol | 100 | 69.83 | 100 | 100 | |
IexecHubAccessor.sol | 100 | 75 | 100 | 100 | |
IexecHubInterface.sol | 100 | 100 | 100 | 100 | |
IexecLib.sol | 100 | 100 | 100 | 100 | |
Marketplace.sol | 100 | 88.89 | 100 | 100 | |
MarketplaceAccessor.sol | 100 | 50 | 100 | 100 | |
MarketplaceInterface.sol | 100 | 100 | 100 | 100 | |
OwnableOZ.sol | 100 | 75 | 100 | 100 | |
SafeMathOZ.sol | 100 | 75 | 100 | 100 | |
TestSha.sol | 100 | 100 | 100 | 100 | |
WorkOrder.sol | 100 | 62.5 | 100 | 100 | |
WorkerPool.sol | 100 | 82.69 | 100 | 100 | |
WorkerPoolHub.sol | 100 | 75 | 100 | 100 | |
-----------------------------|----------|----------|----------|----------|----------------|
All files | 100 | 75.16 | 100 | 100 | |
-----------------------------|----------|----------|----------|----------|----------------|
```
## Oyente analyse see [here](./oyente)
45 changes: 35 additions & 10 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,15 @@ module.exports = function(deployer) {
//mainnet = '0x607F4C5BB672230e8672085532f7e901544a7375'
module.exports = function(deployer) {
let aRLCInstance;
let aWorkerPoolHubInstance;
let aAppHubInstance;
let aDatasetHubInstance;
let aTaskRequestHubInstance;
let aIexecHub;
let aMarketplaceInstance;
let creator;
aRLCInstance='0xc57538846ec405ea25deb00e0f9b29a432d53507';
return deployer.deploy(WorkerPoolHub)
.then(() => WorkerPoolHub.deployed())
.then(instance => {
Expand All @@ -141,13 +145,7 @@ module.exports = function(deployer) {
.then(instance => {
aDatasetHubInstance = instance;
console.log("DatasetHub deployed at address: " + instance.address);
return deployer.deploy(TaskRequestHub);
})
.then(() => TaskRequestHub.deployed())
.then(instance => {
aTaskRequestHubInstance = instance;
console.log("TaskRequestHub deployed at address: " + instance.address);
return deployer.deploy(IexecHub, '0x7314dc4d7794b5e7894212ca1556ae8e3de58621', aWorkerPoolHubInstance.address, aAppHubInstance.address, aDatasetHubInstance.address, aTaskRequestHubInstance.address);
return deployer.deploy(IexecHub, aRLCInstance, aWorkerPoolHubInstance.address, aAppHubInstance.address, aDatasetHubInstance.address);
})
.then(() => IexecHub.deployed())
.then(instance => {
Expand All @@ -165,9 +163,36 @@ module.exports = function(deployer) {
})
.then(() => {
console.log("transferOwnership of DatasetHub to IexecHub");
return aTaskRequestHubInstance.transferOwnership(aIexecHub.address);
return deployer.deploy(Marketplace, aIexecHub.address);
})
.then(() => Marketplace.deployed())
.then(instance => {
aMarketplaceInstance = instance;
console.log("Marketplace deployed at address: " + instance.address);
return aIexecHub.attachMarketplace(instance.address);
})
.then(() => console.log("transferOwnership of TaskRequestHub to IexecHub"));
.then(() => {
console.log("attach Marketplace to IexecHub done");
return aIexecHub.setCategoriesCreator(creator);
})
.then(() => {
console.log("setCategoriesCreator to "+creator);
return readFileAsync("./config/categories.json");
})
.then(categories => {
var categoriesConfigFileJson = JSON.parse(categories);
catagoriesPromises = [];
for(var i = 0; i < categoriesConfigFileJson.categories.length; i++) {
console.log("create category : "+categoriesConfigFileJson.categories[i].name);
catagoriesPromises.push(aIexecHub.createCategory(categoriesConfigFileJson.categories[i].name,JSON.stringify(categoriesConfigFileJson.categories[i].description),categoriesConfigFileJson.categories[i].workClockTimeRef));
}
return Promise.all(catagoriesPromises);
})
.then(categoriesCreated => {
return aIexecHub.m_categoriesCount.call()
})
.then(m_categoriesCount => console.log("m_categoriesCount is now: "+m_categoriesCount))
;
};
**/
42 changes: 42 additions & 0 deletions truffle-hdwallet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = "12 words";


module.exports = {
networks: {
ropsten: {
provider: new HDWalletProvider(mnemonic, "https://ropsten.infura.io/berv5GTB5cSdOJPPnqOq"),
network_id: "3",
gas: 4400000,
gasPrice: 22000000000,
},
rinkeby: {
provider: new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/berv5GTB5cSdOJPPnqOq"),
network_id: "4",
gas: 4400000,
gasPrice: 22000000000,
},
kovan: {
provider: new HDWalletProvider(mnemonic, "https://kovan.infura.io/berv5GTB5cSdOJPPnqOq"),
network_id: "42",
gas: 4400000,
gasPrice: 22000000000,
},/*
mainnet: {
provider: new HDWalletProvider(mnemonic, "https://mainnet.infura.io/berv5GTB5cSdOJPPnqOq"),
network_id: "1",
gas: 4400000,
gasPrice: 22000000000,
},*/
},
solc: {
optimizer: {
enabled: true,
runs: 200
}
},
mocha: {
enableTimeouts: false
}
};

0 comments on commit 1fa4f1e

Please sign in to comment.