-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtruffle-config.js
32 lines (29 loc) · 965 Bytes
/
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
require('dotenv').config();
const mnemonic = process.env.MNEMONIC;
const HDWalletProvider = require("truffle-hdwallet-provider");
// Create your own key for Production environments (https://infura.io/)
const INFURA_ID = process.env.INFURA_ID || 'd6760e62b67f4937ba1ea2691046f06d';
const configNetwok = (network, networkId, path = "m/44'/60'/0'/0/", gas = 4465030, gasPrice = 1e10) => ({
provider: () => new HDWalletProvider(
mnemonic, `https://${network}.infura.io/v3/${INFURA_ID}`,
0, 1, true, path
),
networkId,
gas,
gasPrice,
});
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
},
ropsten: configNetwok('ropsten', 3),
kovan: configNetwok('kovan', 42),
rinkeby: configNetwok('rinkeby', 4),
main: configNetwok('mainnet', 1),
},
};