Blockchain Technology (I): Getting Started with Truffle Development

Blockchain Technology (I): Getting Started with Truffle Development

Article summary image:

Ethereum is the best programming platform in the field of blockchain development, and Truffle is the most popular development framework for Ethereum. This is why we introduce Truffle in our first blockchain technology article. Practice is the most important thing. This article does not explain the principles, but only builds the environment and runs the first blockchain program (Dapp).

Install Truffle
$ npm install -g truffle

Dependencies
NodeJS
Visit https://nodejs.org official website to download and install

System: Windows, Linux or Mac OS X. Mac OS X is recommended. Windows is not recommended because you may encounter various problems and give up.

You need to install the Ethereum client to support the JSON RPC API call development environment. It is recommended to use EthereumJS TestRPC: https://github.com/ethereumjs/testrpc

Installation command:
$ npm install -g ethereumjs-testrpc

Create your first project
$ mkdir zhaoxi
$ cd zhaoxi
$ truffle init
By default, a MetaCoin demo will be generated. You can learn the architecture of Truffle from this demo. The project directory structure is as shown in the figure:

The directory of all project files is as follows:

Compile the project
$ truffle compile

Deploy the project <br/>Start TestRPC before deployment
$ testrpc

deploy
$ truffle deploy

Start the service
$ truffle serve

After starting the service, you can access the project in the browser:
http://localhost:8080/ , the web page interface is as follows:

Well, the first blockchain program is running. You can continue to practice and learn in depth. If you have any questions, please contact me.


<<:  Australian Craig Wright: I am Satoshi Nakamoto

>>:  IBM blockchain service Docker will be deeply integrated with cloud services

Recommend

Facial features of people who are very careful in doing things

As the saying goes, it is better to be safe than ...

Is the fortune of women with high foreheads good?

Everyone says that women with high foreheads are ...

Women must not love irresponsible men

Women all hope that they can find a mature, stabl...

Women with triangular eyes are unlikely to marry well.

Everyone knows that one can tell a person's m...

What does Taiyin entering the marriage palace represent?

Taiyin is the star of wisdom and is also one of t...

What are the characteristics of a man who is unlucky in marriage?

It is generally not advisable to marry a man who ...

Is it good to have two forehead wrinkles? Is it you?

People with two forehead wrinkles have no perseve...

Complete bone structure - Jade bone

Complete bone structure - Jade bone In the back o...

It's so pathetic. Men with these looks won't take any responsibility.

If a man is a coward, not only will people in soc...

How to read the face and tell fortune

The so-called forehead refers to the upper part o...

Do women with the "川" palm have a rough life?

The theme of this issue of physiognomy column is ...

What does peach blossom mean?

What does peach blossom mean? White complexion Pe...

Putin confirms Russia will issue crypto ruble, other countries may follow soon

According to local Russian news sources, Russian ...

A woman with crow's feet when she smiles

I believe many people have heard of crow's fe...