-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtruffle-config.js
43 lines (36 loc) · 1.02 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
require('dotenv').config()
const HDWalletProvider = require('truffle-hdwallet-provider')
const mnemonic = process.env.MNEMONIC
const network = process.env.NETWORK
const IS_DOCKER = process.env.NODE_ENV === 'docker'
const HOST = IS_DOCKER ? 'ganache-cli' : 'localhost'
const LOCAL_NODE_URL = 'http://' + HOST + ':8545'
console.log('Network url', LOCAL_NODE_URL, network)
const provider = new HDWalletProvider(mnemonic, LOCAL_NODE_URL)
console.log(
`Deploying with mnemonic '${mnemonic}'`,
'address',
provider.addresses[0]
)
module.exports = {
migrations_directory: './migrations',
networks: {
development: {
host: HOST,
port: 8545,
network_id: '*', // Match any network id,
from: provider.addresses[0],
gas: '8000000',
gasPrice: '100000000000'
}
},
compilers: {
solc: {
optimizer: {
enabled: true,
runs: 200
},
version: "0.5.8"
}
}
}