Ethereum is the best programming platform in the area of blockchain development, and truffle is the most popular development framework of Ethereum (Ethereum), which is the reason why our first blockchain technology article introduces truffle, the actual combat is the most important thing, this article does not speak the principle, only build the environment, Run the first Blockchain program (DAPP).
Installing truffle
$ NPM install-g Truffle
Dependent environment NodeJS visit https://nodejs.org official website Download install
System: Windows, Linux or Mac OS X, recommended Mac OS X, not recommended for Windows, will encounter a variety of problems that lead to abandonment.
The Ethereum client needs to be installed to support the JSON RPC API call development environment and the recommended use of ETHEREUMJS TESTRPC:HTTPS://GITHUB.COM/ETHEREUMJS/TESTRPC
Install Command: $ NPM install-g ETHEREUMJS-TESTRPC
Create a new first project
$ mkdir Zhaoxi
$ CD Zhaoxi
$ truffle Init
A metacoin demo is generated by default, and you can learn the truffle architecture from this demo.
Project directory Structure
Project All Files directory
Compiling the project
$ truffle Compile
Deployment Project
Start TESTRPC before deploying
$ testrpc
$ truffle deploy (in truffle 2.0 or later, the command becomes: Truffle migrate) $ truffle migrate execution result
Start the service
$ truffle Serve
After starting the service, you can access the project in the browser: http://localhost:8080/, the Web interface is as follows:
Well, the first blockchain is running, and you can keep practicing in-depth learning in the back. If you have any questions, please contact me.
Original: http://wangxiaoming.com/blog/2016/04/30/blockchain-tech-truffle/
Blockchain technology (i): Introduction to truffle development