Introduction to Blockchain truffle 4.1.5 development

Source: Internet
Author: User

I hope you can give a comment, support the next newcomer, grateful.

Blockchain has been very hot in recent years. Truffle is currently the most popular Ethereum development framework.

Many of the online truffle environments are deployed in 2.x or 3.x. The latest truffle has been updated to version 4.1.x. 4.1.x version of the command compared to the previous version of the big difference, many novice (including me) at the beginning of the course in accordance with the online tutorial how all the environment, also reported a lot of errors, causing very uncomfortable, go a lot of detours, today I put the latest truffle 4.1.5 to do a summary, I hope to be of some help, and welcome the criticism.

First I use the Ubuntu 17.1 system (Linux system is almost).

Nodejs Environment Version v8.11.0

Truffle version v4.1.5

The first step: Install NPM and NODEJS environment, installation tutorial I do not repeat, there are many tutorials online.

Step Two: Install Truffle:

NPM Install-g Truffle

Step three: Install the Webpack sample project.

Find a place to open, such as the desktop path or under the user folder under Home, create a new folder such as "demo" to store the truffle project, later terminal startup is in the "demo" Directory to run the command:

Truffle unbox Webpack

Webpack is an official release example of Truffle. These include contracts, migrations, tests, user interfaces, and Webpack to build pipelines. (not good for translation)

The result of the operation is shown in the following figure (Setting up step is a little slow, do not worry more):


Fourth step: Run the development console:

Truffle develop

Operation Result: This terminal console becomes the Truffle development console (development terminal), do not close, inside generated several test accounts.

Fifth step: Compiling and porting:

Here are two methods, the first of which is to enter directly in the development terminal in step 4

Compile migrate

Or add truffle to the new terminal.

Truffle compile
 truffle migrate
This article uses the former method.


Sixth step: Start a new terminal in your project folder, enter

NPM Run Dev

The red circle in the figure is the address deployed by the project, which is opened directly on the browser.

Seventh Step: Recharge your account:

Enter in the development terminal

Test or enter truffle test on the new terminal

This article uses the former.


The final page:


Last attached official English raw meat: http://truffleframework.com/boxes/webpack

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.