fabric安装环境和运行测试网络时的踩坑合集!

问题:fabric下载完成后,fabric-samples文件夹有个小锁头:

解决:

cd到包括fabric-samples文件夹的路径,执行下面的命令:

sudo chmod 777 -R *

原因是目前fabric-samples文件夹没有权限。

chmod:用于改变文件或目录的访问权限。

-R : 对目前目录下的所有档案与子目录进行相同的权限变更(即以递回的方式逐个变更) 。

777:分别对应文件实际拥有者,文件实际拥有者所在的组,其它用户的权限,数字权限是基于八进制数字系统而创建的,读权限(read,r)的值是4,写权限(write,w)的值是2,执行权限(execute,x)的值是1,没有授权的值是0。

*:当前目录下的所有文件及目录。

问题:sudo下找不到go命令

解决:

sudo gedit /etc/sudoers

在Defaults secure_path项加入自己的$GOROOT/bin(比如我的改成的是Defaults secure_path="/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin")

问题:Docker权限 “Got permission denied while trying to connect to the Docker daemon socket at unix:///var/”

解决:

$ sudo gpasswd -a username docker   #将普通用户username加入到docker组

$ newgrp docker  #更新docker组

问题:go代理问题

解决:

$ go env -w GO111MODULE=on

$ go env -w GOPROXY=https://goproxy.cn,direct

问题:出现以下几种invoke错误:

Error: could not assemble transaction: proposal response was not successful, error code 500, msg error in simulation: failed to execute transaction 35d4b9bb5404fb0fff0fbd34b9db0e32180a4ac7318367462ccea7e4cbd965d1: could not launch chaincode basic_1.0:4ec191e793b27e953ff2ede5a8bcc63152cecb1e4c3f301a26e22692c61967ad: chaincode registration failed: container exited with 2 - proposal response: version:1 response:<status:200 >

或者

Fatal error when initializing core config : Could not find config file. Please make sure that FABRIC_CFG_PATH is set to a path which contains core.yaml

或者

Cannot run peer because error when setting up MSP of type bccsp from directory /home/drypot/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp: KeyMaterial not found in SigningIdentityInfo

解决:

重新进入test-network文件路径下sudo su。在root模式下再重新执行

fabric安装环境和运行测试网络时的踩坑合集!

上一篇:学习记录:fabric(6)- 系统设计(2)


下一篇:Fabric官方文档学习①——关键概念