Dapp development series one: Install truffle, web3.js and other basic environments

The installation environment of this article is in the win10 system, and all the commands are confirmed to work in cmd.

Because the author previously worked on a recommendation system, including data storage and front-end display, which were all developed by himself, he still knows a lot about the front-end (high emotional intelligence: the company's business needs to expand, so it needs to be able to handle all development tasks globally. Low) Emotional intelligence: small company). Because the interaction uses web3 and js, you need to have a certain understanding of js.

The front-end interface uses Vue, and the back-end uses blockchain to store a small amount of data (if there is a lot of data, I will definitely not be able to afford the cost). Among them, the smart contract writing language is Solidity (the language is relatively simple, and it is easy for those with programming experience to get started. quick).

Smart contract language solidity learning address: Solidity — Solidity 0.8.14 documentation

Among them, I have already installed node.js, and there is a lot of information, so you can search it by yourself.

1. Check the node installation version

# node -v

 2. Configure taobao image

# npm config set registry https://registry.npm.taobao.org

 Check if it takes effect

# npm config list

You can see that it has become a Taobao resource.

3.Install ganache 

 The main function of ganache is that the local blockchain can simulate the public blockchain, and developers can test transactions on the local blockchain. Later projects are mainly deployed and tested in this environment.

# npm install -g ganache-cli

4. Install web3.js

web3.js mainly interacts with smart contract objects

# npm install web3

 

 5. Install Truffle

# npm install -g truffle

 

 # truffle version

At this point, the basic environment has basically been set up. The choice of IDE depends on your own usage habits. I use vs code because I also like to use vue to write.

In the next chapter we can start writing and testing smart contracts. Stay tuned!

Recommend interesting projects to everyone

Project address: https://cryptozombies.io/zh/course

A tutorial on how to write Dapp, very good for enlightenment

Guess you like

Origin blog.csdn.net/m0_67950768/article/details/124344854