以太坊DApp开发环境搭建-Windows

可能需要:

npm install --global --production windows-build-tools
npm install -g ethereumjs-testrpc
安装python,并配置环境变量
安装pip
python -m pip install -U pip
truffle-contract这个工具是Truffle提供的,用于在NodeJS和浏览器中集成Truffle的合约抽象运行环境
npm install --save truffle-contract
安装NodeJS中用到的Truffle运行时需要的web3环境
npm install --save web3

1.1 安装node.js

下载后直接安装
64位包装包

PS C:\WINDOWS\system32> node -v
v8.10.0

1.2 安装节点仿真器

//安装
npm install –g ganache-cli

//测试
PS C:\WINDOWS\system32> ganache-cli
Ganache CLI v6.2.3 (ganache-core: 2.3.1)

1.3 安装solidity编译器

npm install –g solc

//test ,出错了,但能用,???
PS C:\WINDOWS\system32> solcjs -version
module.js:549
    throw err;
    ^

Error: Cannot find module './smtchecker.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\August\AppData\Roaming\npm\node_modules\solc\solcjs:9:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
PS C:\WINDOWS\system32> solcjs -v
module.js:549
    throw err;

1.4安装web3

npm install –g web3@0.20.2
或 npm install --save web3

1.5 安装truffle框架

npm install –g truffle

PS C:\WINDOWS\system32> truffle.cmd version
Truffle v4.1.14 (core: 4.1.14)
Solidity v0.4.24 (solc-js)

1.6安装webpack

npm install –g webpack@3.11.0
//我没安装,但也能用,???
webpack –v

遇到的问题与解决方案

安装remix-ide提示Cannot find module ‘./build/Release/scrypt’
解决
打开/usr/local/lib/node_modules/remix-ide/node_modules/scrypt/index.js将require("./build/Release/scrypt")改为require(“scrypt”)

如何解决 Command “python setup.py egg_info” failed with error code 1 in \AppData\Local\Temp\pip-i
python -m pip install --upgrade --force pip
pip install pkgconfig

down vote
This is a step-by-step procedure to get pkg-config working on Windows, based on my experience, using the info from Oliver Zendel’s comment.
I assume here that MinGW was installed to C:\MinGW. There were multiple versions of the packages available, and in each case I just downloaded the latest version.
go to http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
download the file pkg-config_0.26-1_win32.zip
extract the file bin/pkg-config.exe to C:\MinGW\bin
download the file gettext-runtime_0.18.1.1-2_win32.zip
extract the file bin/intl.dll to C:\MinGW\bin
go to http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28
download the file glib_2.28.8-1_win32.zip
extract the file bin/libglib-2.0-0.dll to C:\MinGW\bin
Now CMake will be able to use pkg-config if it is configured to use MinGW.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值