Blockchain Enthusiast (qq:53016353)
Digital currency is the best programming platform in the area of blockchain development, and truffle is the most popular development framework of digital currency (Ethereum), this is our first Blockchain technology article introduced truffle reason, the actual combat is the most important thing, this article does not talk about 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.
Need to install Ethereum client to support JSON RPC API call
Development environment, it is recommended to use ETHEREUMJS TESTRPC:C
installation 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 as shown:
0
Project all Files directory as shown:
01_meitu_1
Compiling the project
$ truffle Compile
1
Deployment Project
Start TESTRPC before deploying
$ testrpc
Deployment
$ truffle Deploy
2
Start the service
$ truffle Serve
3
After you start 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.