forked from daostack/arc.js_legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
truffle.js
61 lines (58 loc) · 1.35 KB
/
truffle.js
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
const env = require("env-variable")();
/**
* `truffle migrate` will lock and use this account.
*
* Must look like this:
* {
* "mnemonic" : "an account mnemonic",
* "providerUrl" : "like http://127.0.0.1:8545 or https://[net].infura.io/[token]"
* }
*/
let providerConfig;
let provider;
if (env.arcjs_providerConfig) {
console.log(`providerConfig at: ${env.arcjs_providerConfig}`);
providerConfig = require(env.arcjs_providerConfig);
if (providerConfig) {
const HDWalletProvider = require("truffle-hdwallet-provider");
console.log(`Provider: '${providerConfig.providerUrl}'`);
console.log(`Account: '${providerConfig.mnemonic}'`);
global.provider = provider = new HDWalletProvider(providerConfig.mnemonic, providerConfig.providerUrl);
}
}
module.exports = {
networks: {
live: {
provider: function () {
return provider;
},
gas: 4543760,
gasPrice: 10000000000,
network_id: 1
},
ganache: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
gas: 4543760
},
ropsten: {
provider: function () {
return provider;
},
gas: 4543760,
network_id: 3
},
kovan: {
provider: function () {
return provider;
},
gas: 4543760,
network_id: 42
}
},
rpc: {
host: "127.0.0.1",
port: 8545
}
};