/ truffle.js
truffle.js
 1  const HDWalletProvider = require('truffle-hdwallet-provider')
 2  const fs = require('fs')
 3  
 4  // First read in the secrets.json to get our mnemonic
 5  let secrets
 6  let mnemonic
 7  if (fs.existsSync('secrets.json')) {
 8    secrets = JSON.parse(fs.readFileSync('secrets.json', 'utf8'))
 9    mnemonic = secrets.mnemonic
10  } else {
11    console.log('No secrets.json found. If you are trying to publish EPM ' +
12                'this will fail. Otherwise, you can ignore this message!')
13    mnemonic = ''
14  }
15  
16  module.exports = {
17    networks: {
18      live: {
19        network_id: 1 // Ethereum public network
20        // optional config values
21        // host - defaults to "localhost"
22        // port - defaults to 8545
23        // gas
24        // gasPrice
25        // from - default address to use for any transaction Truffle makes during migrations
26      },
27      ropsten: {
28        provider: new HDWalletProvider(mnemonic, 'https://ropsten.infura.io'),
29        network_id: '3'
30      },
31      testrpc: {
32        network_id: 'default'
33      }
34    }
35  }