脚本宝典收集整理的这篇文章主要介绍了Fabric voteApp应用配置,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
Fabric voteApp应用配置
下载voteApp源码
- gIT clone https://github.COM/didianV5/voteApp.git
- chmod -R 777 voteApp
修改配置文件
- cd voteApp
- cd app
- vim ./startFabric.sh
- 修改其中一行的path为如下:
docker exec -e "CORE_PEER_LOCALMSPID=org1MSP" -e "CORE_PEER_MSPconfigPATH=/opt/gopath/src/github.com/hyperlEdger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode install -n vote -v 1.0 -p /opt/gopath/src/github.com/vote
为链码添加依赖项
- cd /root/go/src/github.com/voteApp/chaincode
- go mod init
- GO111MODULE=on go mod vendor
安装node依赖包
- cd /root/go/src/github.com/voteApp/app
- npm install
- 如果失败,修改node版本:n 8.9.4
- 再次失败,尝试 npm rebuild
启动Fabric网络
- ./startFabric.sh
- 注册管理员:node enrollAdmin.js
- 注册用户:node registerUser.js
- 将当前目录下的hfc-key-Store复制到/root/.hfc-key-store目录下:mv /root/go/src/github.com/voteApp/app/hfc-key-store/ /root/.hfc-key-store
- node index.js
- 访问地址:http://ubuntu201:3000
脚本宝典总结
以上是脚本宝典为你收集整理的Fabric voteApp应用配置全部内容,希望文章能够帮你解决Fabric voteApp应用配置所遇到的问题。
如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。