What is a truffle?
Truffle is a framework for DApp development. It’s be confused with truffle-contract, a library, and abstraction for smart contract interaction, Web3.js. Truffle is great because it to the distributed app development with Unit Testing and continuous integration style workflows. The Website: 40Thttp://truffleframework.com/40T. Ithree things that are worth highlighting:
1. Built-In Smart Contract Compilation, Linking, Deployment, and Binary Management.
We will very quickly realize in Ethereum, that there are multiple compiler implementations for solidity. And if having multiple contracts to be linked together, a team them on a development chain, then path for deployment and compilation is what we .
2. Automated Contract Testing for Rapid Development
3. Network Management for Deployment
With multiple blockchains and multiple developers, it’s always good
How does truffle work?
This should install truffle globally. Remember, truffle and npm don’t have update mechanism, so update the truffle manually from time to time. This usually means uninstalling and re-installing the truffle. As see, the version that got installed is “4.1.11”. Sometimes, when things working as expected, it’s idea to roll back to version. Tbe done by specifying the version number during installation: npm install -g 40Ttruffle@4.0.040T would install truffle version 4.
Let’s quickly discuss the truffle directories:
When we initialize project with truffle init in an empty folder, then truffle will download a scaffolding project from GitHub and unpack it. The project initialized with a default structure, these are the important folders in every truffle project:
The “contracts” folder is where the smart contracts are located. These are the Solidity files.