2.3 创建测试网络的通道
先启动网络
cd $GOPATH/src/github.com/hyperledger/fabric-samples/test-network
./network.sh down
./network.sh up
下面我们在此基础上创建一个默认名叫“mychannel”的通道
./network.sh createChannel
createChannel这个脚本除了创建通道外,还自动把上面创建的三个节点都加到通道里了
安装成功后
可能遇到的问题
问题一
在创建通道过程中可能遇到的问题
Error: failed to create deliver client for orderer: orderer client failed to connect to localhost:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp [::1]:7050: connectex: No connection could be made because the target machine actively refused it."
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
Error !!! Create channel failed
这是说orderer容器连接不上,因为它未启动,但在启动网络时显示已经正常启动,但经过各种调试发现确实是没有启动,应该是启动后又不知什么原因马上自动关闭,可以通过下面的命令查看是否正常
`
docker ps -a
`
这个是失败的,因为PORTS端口没有值
这是正常的
解决方法就是重启docker,我也知道什么原因,什么重启后就好了
问题二
2020-04-10 17:31:45.236 CST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
Error: got unexpected status: BAD_REQUEST -- error applying config update to existing channel 'mychannel': error authorizing update: error validating ReadSet: proposed update requires that key [Group] /Channel/Application be at version 0, but it is currently at version 1
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
Error !!! Create channel failed
应该是之前执行过相关命令,已经生成一些配置,需要执行
./network.sh down
然后再重新启动网络
本文由小韦云原创,转载请注明出处:https://www.bctos.cn/doc/4/1804,否则追究其法律责任