- npm install -g ethereumjs-testrpc
- npm install web3
- 启动 testrpc
- npm install -g truffle 安装truffle(编译、部署智能合约的工具)
- 建立项目目录pet-shop-tutorial,构建truffle项目 起项目 truffle unbox pet-shop 报错
Starting unbox…
✓ Preparing to download box
✖ Downloading
Unbox failed!
Error: connect ECONNREFUSED 0.0.0.0:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
Truffle v5.5.21 (core: 5.5.21)
Node v12.18.3
解决办法
sudo vi /etc/hosts
通过https://www.ipaddress.com 查询 raw.githubusercontent.com 的地址。
配置host文件 增加地址
199.232.68.133 raw.githubusercontent.com
再次构建
truffle unbox pet-shop
Cleaning up temporary files
✓ Setting up box
Unbox successful, sweet!
Commands:
Compile: truffle compile
Migrate: truffle migrate
Test contracts: truffle test
Run dev server: npm run dev
成功!!!