truffle.js 1.1 KB

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