-
Notifications
You must be signed in to change notification settings - Fork 16
/
truffle.js
106 lines (105 loc) · 2.68 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
const HDWalletProvider = require('truffle-hdwallet-provider')
const infuraApiKey = process.env.INFURA_API_KEY
const testnetMnemonic = process.env.TESTNET_MNEMONIC
const mainnetMnemonic = process.env.MAINNET_MNEMONIC
const providerUrl = process.env.PROVIDER_URL
module.exports = {
networks: {
dev: {
host: 'localhost',
port: 8545,
network_id: 4447,
gasPrice: 1e9,
},
devGeth: {
host: 'localhost',
port: 8545,
network_id: '*',
// Values below 6000000 fail often because of the required minimum block gas amount.
gas: 6300000,
},
ropsten: {
network_id: 3,
gas: 4.6e6,
gasPrice: 5e9,
provider: () =>
new HDWalletProvider(
testnetMnemonic,
providerUrl || 'https://ropsten.infura.io/v3/' + infuraApiKey,
0,
10
),
},
kovan: {
network_id: 42,
gas: 6.5e6,
gasPrice: 5e9,
provider: () =>
new HDWalletProvider(
testnetMnemonic,
providerUrl || 'https://kovan.infura.io/v3/' + infuraApiKey,
0,
10
),
},
rinkeby: {
network_id: 4,
gas: 6.5e6,
gasPrice: 5e9,
provider: () =>
new HDWalletProvider(
testnetMnemonic,
providerUrl || 'https://rinkeby.infura.io/v3/' + infuraApiKey,
0,
10
),
},
mainnet: {
network_id: 1,
gas: 6.5e6,
gasPrice: 5e9,
provider: () =>
new HDWalletProvider(
mainnetMnemonic,
providerUrl || 'https://mainnet.infura.io/v3/' + infuraApiKey,
0,
10
),
},
// to be used when we want to interact in a local truffle console session
hdwallet: {
provider: () => {
return new HDWalletProvider(
// NOTE: this can be any valid mnemonic, as long as you are making `calls` and not `transactions`
process.env.HDWALLET_MNEMONIC,
// NOTE: this is the network you want to connect to; if you are running a local network you
// can connect to that instead of infura but then you probably want to use:
// `truffle console --network dev`
providerUrl,
0,
10
)
},
network_id: '*',
},
},
compilers: {
solc: {
version: '0.4.24',
},
},
mocha: {
/*
* Default reporter: 'spec'
* + Prints out test duration
* + Faster
* - Doesn't display gas costs
*
* Gas cost reporter: 'eth-gas-reporter'
* + Can analyze gas costs
* - Slow
* - Doesn't display test duration
*/
reporter: process.env.GAS_REPORTER ? 'eth-gas-reporter' : 'spec',
},
}