fabric-sample配置常见错误解析

1、运行docker-compose -f docker-compose-simple.yaml up 出现下面错误
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
解决:https://github.com/docker/compose/issues/3633
执行:

vim docker-compose-simple.yaml

找到并注释 tty:true, 一共有两个地方,一个在cli,一个在chaincode

cli:
container_name: cli
image: hyperledger/fabric-tools
# tty: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

2、运行CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=mycc:0 ./chaincode_example02 时出现下面错误

2018-06-29 13:04:49.920 UTC [shim] func1 -> ERRO 003 Received error from server, ending chaincode stream: rpc error: code = Unimplemented desc = unknown service protos.ChaincodeSupport
Error starting Simple chaincode: rpc error: code = Unimplemented desc = unknown service protos.

解决:click here
问题是端口设置错误,在v1.1版本peer:7051应该改为peer:7052, 7051是在v1.0使用的端口

CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:0 ./chaincode_example02

3、运行docker-compose -f docker-compose-simple.yaml up时出现下面错误
readset expected key [Group] /Channel/Application at version 0, but got version 1

这是由于之前已经创建过通道,导致重复创建通道

docker rmi -f $(docker ps -aq)
docker-compose -f docker-compose-simple.yaml up

删除原有镜像,重新创建,应该是成功了

4、运行docker exec -it cli bash出现下面错误
Error response from daemon: Container d5fec19ae4624f68893a53bb7bb5417ccb66e7d604200254e4e3cfd03a944172 is not running

这是由于cli已经退出,原因有可能是前面的问题3,按照3重新启动

5、运行./byfn.sh -m up出现下面错误
Error: failed to create deliver client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: context deadline exceeded

原因可能是之前已经启动过orderer结点,导致端口被占用。先关闭在重启

./byfn.sh -m down
./byfn.sh -m up

6、运行make cryptogen出现下面错误
fatal error: ltdl.h: No such file or directory

缺少ltdl.h模块,下载模块重新运行

apt install libltdl3-dev

你可能感兴趣的:(区块链)