创建channel时sudo ./network.sh up createChannel
出现错误
Error: Post "https://localhost:7053/participation/v1/channels": read tcp 127.0.0.1:44780->127.0.0.1:7053: read: connection reset by peer
Channel creation failed
解决方法
1.切换到:/go/src/github.com/hyperledger/fabric/scripts$目录下
sudo chmod +x fabric-samples
2.然后切换到:/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network$
输入:sudo ./network.sh down
3.最后重新进行一下之前的过程
sudo ./network.sh up
sudo ./network.sh up createChannel
注意:一定要有sudo,否者容易出现Failed to generate certificates...
的错误
ubuntu@ubuntu-virtual-machine:~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network$ sudo ./network.sh up
Using docker and docker-compose
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen'
LOCAL_VERSION=2.4.3
DOCKER_IMAGE_VERSION=2.4.3
/home/ubuntu/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network/../bin/cryptogen
Generating certificates using cryptogen tool
Creating Org1 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org1.yaml --output=organizations
org1.example.com
+ res=0
Creating Org2 Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-org2.yaml --output=organizations
org2.example.com
+ res=0
Creating Orderer Org Identities
+ cryptogen generate --config=./organizations/cryptogen/crypto-config-orderer.yaml --output=organizations
+ res=0
Generating CCP files for Org1 and Org2
Creating network "fabric_test" with the default driver
Creating volume "compose_orderer.example.com" with default driver
Creating volume "compose_peer0.org1.example.com" with default driver
Creating volume "compose_peer0.org2.example.com" with default driver
Creating peer0.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating orderer.example.com ... done
Creating cli ... done
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e996d1d7905a hyperledger/fabric-tools:latest "/bin/bash" 3 seconds ago Up Less than a second cli
0619b5d56f4d hyperledger/fabric-peer:latest "peer node start" 6 seconds ago Up 2 seconds 0.0.0.0:9051->9051/tcp, :::9051->9051/tcp, 7051/tcp, 0.0.0.0:9445->9445/tcp, :::9445->9445/tcp peer0.org2.example.com
8923b16fb7bb hyperledger/fabric-peer:latest "peer node start" 6 seconds ago Up 2 seconds 0.0.0.0:7051->7051/tcp, :::7051->7051/tcp, 0.0.0.0:9444->9444/tcp, :::9444->9444/tcp peer0.org1.example.com
7417f9a64605 hyperledger/fabric-orderer:latest "orderer" 6 seconds ago Up 2 seconds 0.0.0.0:7050->7050/tcp, :::7050->7050/tcp, 0.0.0.0:7053->7053/tcp, :::7053->7053/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp orderer.example.com
ubuntu@ubuntu-virtual-machine:~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network$ sudo ./network.sh up createChannel
Using docker and docker-compose
Creating channel 'mychannel'.
If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb
Network Running Already
Using docker and docker-compose
Generating channel genesis block 'mychannel.block'
/home/ubuntu/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/test-network/../bin/configtxgen
+ configtxgen -profile TwoOrgsApplicationGenesis -outputBlock ./channel-artifacts/mychannel.block -channelID mychannel
2022-06-06 18:02:57.550 CST 0001 INFO [common.tools.configtxgen] main -> Loading configuration
2022-06-06 18:02:57.578 CST 0002 INFO [common.tools.configtxgen.localconfig] completeInitialization -> orderer type: etcdraft
2022-06-06 18:02:57.580 CST 0003 INFO [common.tools.configtxgen.localconfig] completeInitialization -> Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:16777216
2022-06-06 18:02: