-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle-config.js
executable file
·63 lines (61 loc) · 1.7 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
55
56
57
58
59
60
61
62
63
var HDWalletProvider = require("truffle-hdwallet-provider");
var fs = require('fs');
var Web3 = require("web3");
var web3 = new Web3();
//Load sercrets.json to read mnumonic private key from JSON key-value pair
var rawdata = fs.readFileSync('secrets.json');
var secrets = JSON.parse(rawdata);
module.exports = {
compilers: {
solc: {
version: "0.6.12",
settings: {
optimizer: {
enabled: true, // Default: false
runs: 200 // Default: 200
}
}
},
},
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*"
},
test: {
host: "127.0.0.1",
port: 7545,
network_id: "*"
},
ropsten: {
provider: function() {
return new HDWalletProvider(secrets.mnemonic, "https://ropsten.infura.io/v3/"+secrets.infuraApiKey);
},
network_id: '3',
gasPrice: web3.utils.toWei('85', 'gwei'), //gas price
gas: 8000000, //gas limit. Block limit is 8000000
timeoutBlocks: 200,
},
kovan: {
provider: function() {
return new HDWalletProvider(secrets.mnemonic, "https://kovan.infura.io/v3/"+secrets.infuraApiKey, 0); //3rd argument, index of account in mnemonic
},
network_id: '42'
},
rinkeby: {
provider: function() {
return new HDWalletProvider(secrets.mnemonic, "https://rinkeby.infura.io/v3/"+secrets.infuraApiKey);
},
network_id: '4'
},
live: {
provider: function() {
return new HDWalletProvider(secrets.mnemonic, "https://mainnet.infura.io/v3/"+secrets.infuraApiKey);
},
network_id: '1',
gasPrice: web3.utils.toWei('85', 'gwei'),
timeoutBlocks: 200,
}
}
};