fabric 启动过程常见问题

错误信息

Error response from daemon: Cannot start container web: iptables failed: iptables -t nat -A DOCKER -p tcp -d 0/0 –dport 32797 -j DNAT –to-destination 172.17.0.30:5000 ! -i docker0: iptables: No chain/target/match by that name.

解决办法:重建docker0网络恢复

依次执行下面的命令:

pkill docker 
iptables -t nat -F 
ifconfig docker0 down 
brctl delbr docker0 
docker -d 
service docker restart

执行
./peer.sh chaincode package demo-pack.out -n demo -v 0.0.1 -s -S -p github.com/introclass/hyperledger-fabric-chaincodes/demo
错误信息
Error: error getting chaincode code demo: error getting chaincode package bytes: Error obtaining dependencies for github.com/hyperledger/fabric/core/chaincode/lib/cid: command <go list -f {{ join .Deps "\n"}} github.com/hyperledger/fabric/core/chaincode/lib/cid>: failed with error: "exit status 1"
can't load package: package github.com/hyperledger/fabric/core/chaincode/lib/cid: cannot find package "github.com/hyperledger/fabric/core/chaincode/lib/cid" in any of:
	/opt/go/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOROOT)
	/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOPATH)


docker cp /Users/qifei/syswin/fabric-deploy/fabric1.4.0/fabric-samples/chaincode/abac/go/vendor/github.com/hyperledger/fabric/core/chaincode/shim/ext/cid  cli:/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/lib

解决npm ERR! 过程出现 Unexpected end of JSON input while parsing near
  1. 删掉package.lock.json
  2. 清除cache
npm cache clean --force
  1. 还原官方镜像
npm set registry https://registry.npmjs.org/

Handshake failed with fatal error SSL_ERROR_SSL

ssl证书错误,找到对应证书或不适用加密连接


服务启动时好时坏,环境清理之后解决

docker rm -f $(docker ps -aq)
docker rmi -f $(docker images | grep fabcar | awk ‘{print $3}’)
rm -rf channel-artifacts crypto-config
mkdir channel-artifacts crypto-config
docker volume prune
docker network rm net_byfn
./byfn.sh generate

./byfn.sh restart


错误信息

2019-10-12 08:04:58.663 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST – error validating channel creation transaction for new channel ‘mychannel’, could not succesfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group] /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the ‘Admins’ sub-policies to be satisfied

CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE 需要配置


端口bind失败

lsof -i:7050
然后kill

初始化合约失败

调用 peer chaincode instantiate响应错误:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

原因是使用java编写的链码,不能出现中文字符。
在初始化合约时,fabric会启动一个hyperledger/fabric-javaenv 的容器对合约进行下载依赖包及编译。编译过程可以查看日志,而编译结束,无论成功失败,容器都会被删掉。

Gradle build
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
:compileJava
Download https://repo.maven.apache.org/maven2/org/hyperledger/fabric-chaincode-java/fabric-chaincode-shim/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/org/hyperledger/fabric-chaincode-java/fabric-chaincode-shim/1.4.3/fabric-chaincode-shim-1.4.3.pom
Download https://repo.maven.apache.org/maven2/com/alibaba/fastjson/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/com/alibaba/fastjson/1.2.62/fastjson-1.2.62.pom
Download https://repo.maven.apache.org/maven2/io/grpc/grpc-core/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/io/netty/netty-codec-http2/maven-metadata.xml
Download https://repo.maven.apache.org/maven2/com/alibaba/fastjson/1.2.62/fastjson-1.2.62.jar
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:42: error: unmappable character for encoding ASCII
            _logger.info("time???" + stub.getTxTimestamp().getNano());
                              ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:42: error: unmappable character for encoding ASCII
            _logger.info("time???" + stub.getTxTimestamp().getNano());
                               ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:42: error: unmappable character for encoding ASCII
            _logger.info("time???" + stub.getTxTimestamp().getNano());
                                ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:44: error: unmappable character for encoding ASCII
            _logger.info(new String("operater???" + creator));
                                             ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:44: error: unmappable character for encoding ASCII
            _logger.info(new String("operater???" + creator));
                                              ^
/chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java:44: error: unmappable character for encoding ASCII
            _logger.info(new String("operater???" + creator));
                                               ^
Note: /chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /chaincode/input/src/src/main/java/com/zhengtoon/chaincode/fuzhou/IntegralChaincode.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值