Advanced Truffle configuration
Configurations in Truffle are stored as a JavaScript file in the root of the project. This helps in configuring various aspects of the project including network, accounts, cost, and so on. In this recipe, you will learn about the various configuration options available in Truffle.
Getting ready
You need to have Truffle installed on your machine to step through this recipe. Verify the installation using the truffle version command.
How to do it...
Create a configuration file called
truffle.js
at the root of your project. It should be a JavaScript file that exports the configuration as an object in the required format.If you are using Windows, rename the configuration file to something like
truffle-config.js
to avoid any naming conflicts with the truffle command.
- Include the network object in the configuration file, which contains the network endpoint for deployment. It will connect the application to an environment running on localhost:8545 for migration and testing...