truffle-config.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /**
  2. * Use this file to configure your truffle project. It's seeded with some
  3. * common settings for different networks and features like migrations,
  4. * compilation and testing. Uncomment the ones you need or modify
  5. * them to suit your project as necessary.
  6. *
  7. * More information about configuration can be found at:
  8. *
  9. * trufflesuite.com/docs/advanced/configuration
  10. *
  11. * To deploy via Infura you'll need a wallet provider (like @truffle/hdwallet-provider)
  12. * to sign your transactions before they're sent to a remote public node. Infura accounts
  13. * are available for free at: infura.io/register.
  14. *
  15. * You'll also need a mnemonic - the twelve word phrase the wallet uses to generate
  16. * public/private key pairs. If you're publishing your code to GitHub make sure you load this
  17. * phrase from a file you've .gitignored so it doesn't accidentally become public.
  18. *
  19. */
  20. // const HDWalletProvider = require('@truffle/hdwallet-provider');
  21. //
  22. // const fs = require('fs');
  23. // const mnemonic = fs.readFileSync(".secret").toString().trim();
  24. module.exports = {
  25. /**
  26. * Networks define how you connect to your ethereum client and let you set the
  27. * defaults web3 uses to send transactions. If you don't specify one truffle
  28. * will spin up a development blockchain for you on port 9545 when you
  29. * run `develop` or `test`. You can ask a truffle command to use a specific
  30. * network from the command line, e.g
  31. *
  32. * $ truffle test --network <network-name>
  33. */
  34. networks: {
  35. // Useful for testing. The `development` name is special - truffle uses it by default
  36. // if it's defined here and no other network is specified at the command line.
  37. // You should run a client (like ganache-cli, geth or parity) in a separate terminal
  38. // tab if you use this network and you must also set the `host`, `port` and `network_id`
  39. // options below to some value.
  40. //
  41. // development: {
  42. // host: "127.0.0.1", // Localhost (default: none)
  43. // port: 8545, // Standard Ethereum port (default: none)
  44. // network_id: "*", // Any network (default: none)
  45. // },
  46. // Another network with more advanced options...
  47. // advanced: {
  48. // port: 8777, // Custom port
  49. // network_id: 1342, // Custom network
  50. // gas: 8500000, // Gas sent with each transaction (default: ~6700000)
  51. // gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei)
  52. // from: <address>, // Account to send txs from (default: accounts[0])
  53. // websocket: true // Enable EventEmitter interface for web3 (default: false)
  54. // },
  55. // Useful for deploying to a public network.
  56. // NB: It's important to wrap the provider as a function.
  57. // ropsten: {
  58. // provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
  59. // network_id: 3, // Ropsten's id
  60. // gas: 5500000, // Ropsten has a lower block limit than mainnet
  61. // confirmations: 2, // # of confs to wait between deployments. (default: 0)
  62. // timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
  63. // skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
  64. // },
  65. // Useful for private networks
  66. // private: {
  67. // provider: () => new HDWalletProvider(mnemonic, `https://network.io`),
  68. // network_id: 2111, // This network is yours, in the cloud.
  69. // production: true // Treats this network as if it was a public net. (default: false)
  70. // }
  71. },
  72. // Set default mocha options here, use special reporters etc.
  73. mocha: {
  74. // timeout: 100000
  75. },
  76. // Configure your compilers
  77. compilers: {
  78. solc: {
  79. version: "0.6.7", // Fetch exact version from solc-bin (default: truffle's version)
  80. // docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
  81. // settings: { // See the solidity docs for advice about optimization and evmVersion
  82. // optimizer: {
  83. // enabled: false,
  84. // runs: 200
  85. // },
  86. // evmVersion: "byzantium"
  87. // }
  88. },
  89. },
  90. // Truffle DB is currently disabled by default; to enable it, change enabled:
  91. // false to enabled: true. The default storage location can also be
  92. // overridden by specifying the adapter settings, as shown in the commented code below.
  93. //
  94. // NOTE: It is not possible to migrate your contracts to truffle DB and you should
  95. // make a backup of your artifacts to a safe location before enabling this feature.
  96. //
  97. // After you backed up your artifacts you can utilize db by running migrate as follows:
  98. // $ truffle migrate --reset --compile-all
  99. //
  100. // db: {
  101. // enabled: false,
  102. // host: "127.0.0.1",
  103. // adapter: {
  104. // name: "sqlite",
  105. // settings: {
  106. // directory: ".db"
  107. // }
  108. // }
  109. // }
  110. };