truffle.js 976 B

123456789101112131415161718192021222324252627282930313233343536
  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. }
  33. }