-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtruffle.js
50 lines (48 loc) · 1.34 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
require('dotenv').config()
const HDWalletProvider = require("truffle-hdwallet-provider");
const NonceTrackerSubprovider = require("web3-provider-engine/subproviders/nonce-tracker")
module.exports = {
networks: {
develop: {
host: "0.0.0.0",
port: 9545,
network_id: "*", // Match any network id
gas: 7e6
},
poa: {
host: "104.236.47.153",
port: 4000,
network_id: 9, // Match any network id
gas: 8e6
},
ropsten: {
provider: () => {
const wallet = new HDWalletProvider(process.env.PHRASE, `https://ropsten.infura.io/${process.env.INFURA_API}`);
const nonceTracker = new NonceTrackerSubprovider();
wallet.engine._providers.unshift(nonceTracker);
nonceTracker.setEngine(wallet.engine);
return wallet;
},
network_id: 3,
gas: 47e5
},
mainnet: {
provider: () => {
const wallet = new HDWalletProvider(process.env.PHRASE, `https://mainnet.infura.io/${process.env.INFURA_API}`);
const nonceTracker = new NonceTrackerSubprovider();
wallet.engine._providers.unshift(nonceTracker);
nonceTracker.setEngine(wallet.engine);
return wallet;
},
network_id: 1,
gas: 7e6,
gasPrice: 10e9 // 10 gwei
}
},
solc: {
optimizer: {
enabled: true,
runs: 200
}
}
};