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

What does it mean if there is only one dustpan for fingerprints?

Fingerprint prediction 1: basket, basket, basket,...

BitcoinSV Node Team releases node software v1.0.0

The BitcoinSV node team officially released node ...

Analysis: Does a big nose bring good fortune?

In physiognomy, the nose represents the palace of...

Palmistry characteristics of women who are as timid as mice

Women with low self-esteem There is a type of wom...

People with round foreheads are not suitable for office romances

The forehead plays an important role in physiogno...

What does it mean when there is no life line on the palm?

In palmistry, the life line, wisdom line and love...

Is it good for a woman to have high cheekbones?

It is said that everyone loves beauty. Everyone c...

What kind of woman is infatuated?

What kind of woman is infatuated? infatuation? Th...

How to read the love line in palmistry

There are many different palm lines in our palms,...

A woman with a pointed head and narrow forehead has a childish personality

Women with pointed heads and narrow foreheads ten...

What is the special meaning of moles on the ears?

Compared with moles on the face, nose bridge or f...

How Filecoin performs storage and retrieval transactions

This post explains how Filecoin transactions work...

Is it good to have silkworm eyes?

Is it good to have silkworm eyes? What do "e...