本文参考:Hyperledger Fabric系列之五:Fabric2.2.1部署-采的坑及解决办法-Centos7 | 林栖云-微服务架构 的 低代码开发平台Fabric 低代码 微服务 林栖云 区块链http://www.linxyun.com/blog/article/8

1.container: API error (404): network fabric_test not found"

问题可能的原因:docker-compose版本从1.28.*以后读取配置文件不同,导致.env文件中配置的环境变量没生效,解决办法:

先册除网络:./network.sh down

在把.env中的环境变量直接放在.network.sh中export,然后再./network.sh up

2.UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]

问题可能的原因是操作的组件没有用tls加密码或密钥文件加载错了。

解决办法:查看组织配置的环境变量是否正确,CORE_PEER_TLS_ENABLED=true必须配置。

export CORE_PEER_TLS_ENABLED=true
export PATH=/opt/workspace/gowork/hyperledger/fabric/scripts/fabric-samples/bin:$PATH
export FABRIC_CFG_PATH=/opt/workspace/gowork/hyperledger/fabric/scripts/fabric-samples/config/
export CORE_PEER_LOCALMSPID=Org1MSP
# export CORE_PEER_TLS_ROOTCERT_FILE=/opt/workspace/gowork/hyperledger/fabric/scripts/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tls/ca.crt
export CORE_PEER_TLS_ROOTCERT_FILE=/opt/workspace/gowork/hyperledger/fabric/scripts/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_MSPCONFIGPATH=/opt/workspace/gowork/hyperledger/fabric/scripts/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
# export CORE_PEER_ADDRESS=org1.example.com:7051
export CORE_PEER_ADDRESS=localhost:7051

3.执行“./network.sh deployCC”时报错“No chaincode name was provided”

更换指令为:

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

4.“failed to normalize chaincode path: ‘go list‘ failed with: ···connection refused:exit status 1”

增加go代理:

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

5.运行./network.sh时报WARNING: IPv4 forwarding is disabled. Networking will not work.

需要做如下配置:

vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:

net.ipv4.ip_forward=1

重启network服务
systemctl restart network

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐