-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtruffle-config.js
54 lines (51 loc) · 1.37 KB
/
truffle-config.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
const path = require("path");
require('dotenv').config();
var devNetworkHost = process.env["DEV_NETWORK"];
var apiKey = process.env["API_KEY"];
var mnemonic = process.env["MNEMONIC"];
var HDWalletProvider = require("truffle-hdwallet-provider");
config = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
mainnet: {
host: "localhost",
provider: function () {
return new HDWalletProvider(mnemonic, "https://mainnet.infura.io/v3/" + apiKey);
},
network_id: 1,
gas: 6700000,
gasPrice: 10000000000
},
rinkeby: {
host: "localhost",
provider: function () {
return new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/v3/" + apiKey);
},
network_id: 4,
gas: 6700000,
gasPrice: 10000000000
},
develop: {
port: 8545
},
},
mocha: {
reporter: 'xunit',
reporterOptions: {
output: 'TEST-results.xml'
}
}
};
// Using this code I can default to using the built in test
// network but define a dev
// Network in my CI system without breaking a developer inner loop.
if (devNetworkHost) {
config.networks["development"] = {
host: devNetworkHost,
port: 8545,
network_id: '*'
};
}
module.exports = config;