truffle-config.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. * truffleframework.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. // const infuraKey = "fj4jll3k.....";
  22. //
  23. // const fs = require('fs');
  24. // const mnemonic = fs.readFileSync(".secret").toString().trim();
  25. module.exports = {
  26. /**
  27. * Networks define how you connect to your ethereum client and let you set the
  28. * defaults web3 uses to send transactions. If you don't specify one truffle
  29. * will spin up a development blockchain for you on port 9545 when you
  30. * run `develop` or `test`. You can ask a truffle command to use a specific
  31. * network from the command line, e.g
  32. *
  33. * $ truffle test --network <network-name>
  34. */
  35. networks: {
  36. // Useful for testing. The `development` name is special - truffle uses it by default
  37. // if it's defined here and no other network is specified at the command line.
  38. // You should run a client (like ganache-cli, geth or parity) in a separate terminal
  39. // tab if you use this network and you must also set the `host`, `port` and `network_id`
  40. // options below to some value.
  41. //
  42. development: {
  43. host: process.env.RPC_HOST || '127.0.0.1', // Localhost (default: none)
  44. port: process.env.RPC_PORT || 8545, // Standard Ethereum port (default: none)
  45. network_id: process.env.BSC_CHAIN_ID, // Any network (default: none)
  46. },
  47. },
  48. // Set default mocha options here, use special reporters etc.
  49. mocha: {
  50. // timeout: 100000
  51. },
  52. // Configure your compilers
  53. compilers: {
  54. solc: {
  55. version: "0.6.4", // Fetch exact version from solc-bin (default: truffle's version)
  56. docker: false, // Use "0.5.1" you've installed locally with docker (default: false)
  57. settings: { // See the solidity docs for advice about optimization and evmVersion
  58. optimizer: {
  59. enabled: true,
  60. runs: 200
  61. }
  62. }
  63. }
  64. }
  65. }