Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build the windows ethernet development environment

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to build the development environment of windows Ethernet Fang. maybe many people don't know much about it. In order to make you understand better, the editor summarizes the following contents for you. I hope you can get something according to this article.

Install DApp development environment 1.1 install Node.js

We use the official long-supported version of 8.10.0LTS, click this link to download the 32-bit installation package, which can be used on both 32-bit and 64-bit systems. If you confirm that your system is 64-bit, you can also download 64-bit packages. Download and install it directly. After installation, open a console window and you can use node:

C:\ Users\ hubwiz > node-vv8.10.01.2 install Node Emulator

In order to quickly develop and test the Ethernet Square DApp, we usually use the Ethernet Square node simulator to simulate the blockchain. The most popular node simulator is Ganache, formerly known as TeseRPC.

Execute the following command on the console:

C:\ Users\ hubwiz > npm install-g ganache-cli

After the installation is complete, execute the command to verify that the installation is successful:

C:\ Users\ hubwiz > ganache-cliGanache CLI v6.0.3 (ganache-core: 2.0.2)

To learn more about the use of the ganache command line, check out the detailed explanation of the command line parameters of Ganache CLI

If you are Win10, you can also download the precompiled Win10 package and install the graphical version of ganache.

1.3 install the solidity compiler

Solidity is the programming language for the development of ethernet intelligent contract. If you are not familiar with it, you can check out the brief introduction of ethernet square solitary development language.

C:\ Users\ hubwiz > npm install-g solc

After the installation is complete, execute the command to verify that the installation is successful

C:\ Users\ hubwiz > solcjs-version0.40.2+commit.3155dd80.Emscripten.clang1.4 install web3C:\ Users\ hubwiz > npm install-g web3@0.20.2

Installation verification:

C:\ Users\ hubwiz > node-p 'require ("web3")' {[Function: Web3] providers: {… }} 1.5 install the truffle framework

Execute the following command to install the truffle development framework:

C:\ Users\ hubwiz > npm install-g truffle

Verify the installation:

C:\ Users\ hubwiz > truffle.cmd versionTruffle v4.1.3 (core 4.1.3) 1.6 install webpack

Execute the following command to install webpack:

C:\ Users\ hubwiz > npm install-g webpack@3.11.0

Verify the installation:

C:\ Users\ hubwiz > webpack-v3.11.02. Build sample project 2.1 New DApp project

Execute the following command to create a project directory and enter it:

C:\ Users\ hubwiz > mkdir demoC:\ Users\ hubwiz > cd demo

Then initialize the project skeleton structure with the webpack template:

C:\ Users\ hubwiz\ demo > truffle.cmd unbox webpackDownloading... Unpacking... Setting up... Unbox successful. Sweet 2.2 install the NPM package on which the project depends

Execute the following command to install the nmp package:

C:\ Users\ hubwiz\ demo > npm install2.3 modifies truffle configuration

If you use a graphical version of ganache, you do not need to modify the truffle.js configuration file. Otherwise, you need to change the port to 8545 in truffle.js, because ganache-cli listens on port 8545:

Module.exports = {networks: {development: {port: 8545} 2.4 start the node

Execute the following command to start the node emulator to deploy the contract and execute the transaction:

C:\ Users\ hubwiz\ demo > ganache-cli2.5 compilation contract

Execute the following command to compile the project contract:

C:\ Users\ hubwiz\ demo > truffle.cmd compile2.6 deployment contract:

Execute the following command to deploy the contract:

C:\ Users\ hubwiz\ demo > truffle.cmd migrate2.7 starts DApp

Execute the following command to start DApp:

C:\ Users\ hubwiz\ demo > npm run dev

You can access http://localhost:8080 in your browser.

If you want to be able to access your DApp application from another machine, modify package.json:

{scripts: {"dev": "webpack-dev-server-- host 0.0.0.0"}} after reading the above, do you have any further understanding of how to build the windows ethernet development environment? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report