truffle-config.js
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 21 const Web3 = require('web3'); 22 23 module.exports = { 24 /** 25 * Networks define how you connect to your ethereum client and let you set the 26 * defaults web3 uses to send transactions. If you don't specify one truffle 27 * will spin up a development blockchain for you on port 9545 when you 28 * run `develop` or `test`. You can ask a truffle command to use a specific 29 * network from the command line, e.g 30 * 31 * $ truffle test --network <network-name> 32 */ 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 42 //for eth 43 /*development: { 44 host: "127.0.0.1", // Localhost (default: none) 45 port: 7545, // Standard Ethereum port (default: none) 46 network_id: "*", // Any network (default: none) 47 gas: 8000000, 48 },*/ 49 50 development: { 51 provider: () => new Web3.providers.HttpProvider('http://127.0.0.1:9545/ext/bc/C/rpc'), 52 network_id: "*", 53 gas: 8000000, 54 gasPrice: 25000000000 55 } 56 57 // Useful for private networks 58 // private: { 59 // provider: () => new HDWalletProvider(mnemonic, `https://network.io`), 60 // network_id: 2111, // This network is yours, in the cloud. 61 // production: true // Treats this network as if it was a public net. (default: false) 62 // } 63 }, 64 65 // Set default mocha options here, use special reporters etc. 66 mocha: { 67 // timeout: 100000 68 }, 69 70 // Configure your compilers 71 compilers: { 72 solc: { 73 version: "0.6.0", // Fetch exact version from solc-bin (default: truffle's version) 74 // docker: true, // Use "0.5.1" you've installed locally with docker (default: false) 75 settings: { // See the solidity docs for advice about optimization and evmVersion 76 optimizer: { 77 enabled: true, 78 runs: 200 79 } 80 } 81 // evmVersion: "byzantium" 82 // } 83 } 84 }, 85 }