上篇我们已经成功启动了Fabric1.0.0网络并测试成功,但是1.0.0确实有点久远了,还是跟着上篇参考文章大佬的脚步来启动一把1.4.3试试。操作如下:

1、先切换分支到1.4.3 执行下载Fabric镜像脚本

因为上篇文章我们删除了已经下载的Fabric镜像,所以在切换到1.4.3分支之后,需要重新下载镜像,这里也提供了一键下载的命令。(V1.0.0分支改动了些东西,所以需要提交下,再切换分支)

切换到scripts目录 并执行脚本bootstrap.sh

cd ~/go/src/github.com/hyperledger/fabric/scripts
./bootstrap.sh

1.执行之后报错:

报错原因:
nexus.hyperledger.org这个网站不再维护了,需要把脚本中nexus.hyperledger.org位置替换一下
解决方案:
执行vim bootstrap.sh,搜索nexus.hyperledger.org ,进行修改

#改造前:
binariesInstall() {echo "===> Downloading version ${FABRIC_TAG} platform specific fabric binaries"binaryDownload ${BINARY_FILE} https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/${BINARY_FILE}if [ $? -eq 22 ]; thenechoecho "------> ${FABRIC_TAG} platform specific fabric binary is not available to download <----"echofiecho "===> Downloading version ${CA_TAG} platform specific fabric-ca-client binary"binaryDownload ${CA_BINARY_FILE} https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/${ARCH}-${CA_VERSION}/${CA_BINARY_FILE}if [ $? -eq 22 ]; thenechoecho "------> ${CA_TAG} fabric-ca-client binary is not available to download  (Available from 1.1.0-rc1) <----"echofi
}
#改造后:
binariesInstall() {echo "===> Downloading version ${FABRIC_TAG} platform specific fabric binaries"  binaryDownload ${BINARY_FILE} https://github.com/hyperledger/fabric/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/${BINARY_FILE}if [ $? -eq 22 ]; thenechoecho "------> ${FABRIC_TAG} platform specific fabric binary is not available to download <----"echofiecho "===> Downloading version ${CA_TAG} platform specific fabric-ca-client binary"  binaryDownload ${CA_BINARY_FILE} https://github.com/hyperledger/fabric/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/${ARCH}-${CA_VERSION}/${CA_BINARY_FILE}if [ $? -eq 22 ]; thenechoecho "------> ${CA_TAG} fabric-ca-client binary is not available to download  (Available from 1.1.0-rc1) <----"echofi
}

再次执行./bootstrap.sh,

halfape@halfape-VirtualBox:~/go/src/github.com/hyperledger/fabric/scripts$ ./bootstrap.sh

发现可以正常下载镜像文件了。

2、创建channel

切换到first-network目录

cd fabric-samples/first-network/

创建第一个 channel(mychannel为通道名称,不写默认为 mychannel,可以自己定义):

./byfn.sh -m generate -c mychannel

又报错:

网上给出答案:

在启动fabric中first-network网络时,需要执行一个自动化脚本:
./byfn.sh -m generate
该脚本需要自动生成相关证书信息,fabric官方提供了两款工具:configtxgen、cryptogen。在脚本执行中会从fabric-simple/bin中取查找并调用两者。初次启动时没有这个工具的。
解决方法:
进入fabric目录,看见make* 文件,使用make configtxgen、make cryptogen两个指令生成工具(如果之前搭建过fabric-1.0环境,直接进fabric/build将bin文件夹直接移动到fabric-sample目录即可)。生成后的文件再fabric/build/bin里面,移动到相关位置即可。

操作如下:

我天,不知道贴上面解决方案的那个大佬 是不是真就那么解决文件了。我一顿好找,才发现build
原来是隐藏文件。。我简直奔溃,网上的方案都试了一遍,都不行。不过总体一个思路是对的,那就是
该脚本需要自动生成相关证书信息,fabric官方提供了两款工具:configtxgen、cryptogen。在脚本执行中会从fabric-simple/bin中取查找并调用两者。初次启动时没有这个工具的。.

所以:

cd ~/go/src/github.com/hyperledger/fabric/.build
sudo cp ./bin/* ../scripts/fabric-samples/bin/

然后再次执行:

cd ~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network
./byfn.sh -m generate -c mychannel

可。可。可。 终于成功了。

halfape@halfape-VirtualBox:~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network$ ./byfn.sh -m generate -c mychannel
Generating certs and genesis block for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
/home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/../bin/cryptogen##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +xGenerate CCP files for Org1 and Org2
/home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/../bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
CONSENSUS_TYPE=solo
+ '[' solo == solo ']'
+ configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
2020-09-24 18:50:53.179 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-09-24 18:50:53.301 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: solo
2020-09-24 18:50:53.301 CST [common.tools.configtxgen.localconfig] Load -> INFO 003 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:53.427 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 004 orderer type: solo
2020-09-24 18:50:53.427 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 005 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:53.428 CST [common.tools.configtxgen] doOutputBlock -> INFO 006 Generating genesis block
2020-09-24 18:50:53.429 CST [common.tools.configtxgen] doOutputBlock -> INFO 007 Writing genesis block
+ res=0
+ set +x#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2020-09-24 18:50:53.467 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-09-24 18:50:53.590 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:53.738 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2020-09-24 18:50:53.738 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:53.738 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 005 Generating new channel configtx
2020-09-24 18:50:53.740 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 006 Writing new channel tx
+ res=0
+ set +x#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2020-09-24 18:50:53.777 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-09-24 18:50:53.901 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:54.029 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2020-09-24 18:50:54.029 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:54.029 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2020-09-24 18:50:54.029 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 Writing anchor peer update
+ res=0
+ set +x#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
2020-09-24 18:50:54.067 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-09-24 18:50:54.195 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:54.321 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2020-09-24 18:50:54.321 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/halfape/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2020-09-24 18:50:54.321 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2020-09-24 18:50:54.321 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 Writing anchor peer update
+ res=0
+ set +xhalfape@halfape-VirtualBox:~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network$

3、first-network 的启动

指定通道名,启动网络:

./byfn.sh -m up -c mychannel

成功的话,会有大大的start和end哦,至于中间报了命令未找到,也很纳闷

halfape@halfape-VirtualBox:~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network$ ./byfn.sh -m up -c mychannel
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
./byfn.sh: line 124: configtxlator: command not found
LOCAL_VERSION=
DOCKER_IMAGE_VERSION=1.4.3
=================== WARNING ===================Local fabric binaries and docker images are  out of  sync. This may cause problems.
===============================================
Creating network "net_byfn" with the default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_orderer.example.com" with default driver
Creating peer0.org1.example.com ...
Creating peer1.org2.example.com ...
Creating peer1.org1.example.com ...
Creating peer0.org1.example.com
Creating orderer.example.com ...
Creating peer0.org2.example.com ...
Creating orderer.example.com
Creating peer1.org2.example.com
Creating peer1.org1.example.com
Creating orderer.example.com ... done
Creating cli ...
Creating cli ... done
CONTAINER ID        IMAGE                               COMMAND             CREATED             STATUS              PORTS                      NAMES
3e21e1b30504        hyperledger/fabric-tools:latest     "/bin/bash"         4 seconds ago       Up 2 seconds                                   cli
59db1504493a        hyperledger/fabric-peer:latest      "peer node start"   10 seconds ago      Up 4 seconds        0.0.0.0:9051->9051/tcp     peer0.org2.example.com
d159d2a1ea36        hyperledger/fabric-orderer:latest   "orderer"           10 seconds ago      Up 4 seconds        0.0.0.0:7050->7050/tcp     orderer.example.com
6d43e8708a68        hyperledger/fabric-peer:latest      "peer node start"   10 seconds ago      Up 4 seconds        0.0.0.0:10051->10051/tcp   peer1.org2.example.com
604251517f0c        hyperledger/fabric-peer:latest      "peer node start"   10 seconds ago      Up 4 seconds        0.0.0.0:8051->8051/tcp     peer1.org1.example.com
604b3b0157dc        hyperledger/fabric-peer:latest      "peer node start"   10 seconds ago      Up 4 seconds        0.0.0.0:7051->7051/tcp     peer0.org1.example.com____    _____      _      ____    _____
/ ___|  |_   _|    / \    |  _ \  |_   _|
\___ \    | |     / _ \   | |_) |   | |  ___) |   | |    / ___ \  |  _ <    | |
|____/    |_|   /_/   \_\ |_| \_\   |_|  Build your first network (BYFN) end-to-end testChannel name : mychannel
Creating channel...
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2020-09-24 11:02:38.037 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-09-24 11:02:38.099 UTC [cli.common] readBlock -> INFO 002 Received block: 0
===================== Channel 'mychannel' created ===================== Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2020-09-24 11:02:38.257 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-09-24 11:02:38.383 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org1 joined channel 'mychannel' ===================== + peer channel join -b mychannel.block
+ res=0
+ set +x
2020-09-24 11:02:41.526 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-09-24 11:02:41.597 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org1 joined channel 'mychannel' ===================== + peer channel join -b mychannel.block
+ res=0
+ set +x
2020-09-24 11:02:44.740 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-09-24 11:02:44.820 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org2 joined channel 'mychannel' ===================== + peer channel join -b mychannel.block
+ res=0
+ set +x
2020-09-24 11:02:47.928 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-09-24 11:02:47.988 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org2 joined channel 'mychannel' ===================== Updating anchor peers for org1...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org1MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2020-09-24 11:02:51.069 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-09-24 11:02:51.118 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org1MSP' on channel 'mychannel' ===================== Updating anchor peers for org2...
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org2MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2020-09-24 11:02:54.203 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-09-24 11:02:54.217 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' ===================== Installing chaincode on peer0.org1...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2020-09-24 11:02:57.325 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2020-09-24 11:02:57.325 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2020-09-24 11:02:58.911 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >
===================== Chaincode is installed on peer0.org1 ===================== Install chaincode on peer0.org2...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2020-09-24 11:02:59.045 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2020-09-24 11:02:59.045 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2020-09-24 11:02:59.249 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >
===================== Chaincode is installed on peer0.org2 ===================== Instantiating chaincode on peer0.org2...
+ peer chaincode instantiate -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc -l golang -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P 'AND ('\''Org1MSP.peer'\'','\''Org2MSP.peer'\'')'
+ res=0
+ set +x
2020-09-24 11:02:59.332 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2020-09-24 11:02:59.332 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
===================== Chaincode is instantiated on peer0.org2 on channel 'mychannel' ===================== Querying chaincode on peer0.org1...
===================== Querying on peer0.org1 on channel 'mychannel'... =====================
Attempting to Query peer0.org1 ...3 secs
+ peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'
+ res=0
+ set +x100
===================== Query successful on peer0.org1 on channel 'mychannel' =====================
Sending invoke transaction on peer0.org1 peer0.org2...
+ peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses peer0.org2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"Args":["invoke","a","b","10"]}'
+ res=0
+ set +x
2020-09-24 11:04:10.235 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
===================== Invoke transaction successful on peer0.org1 peer0.org2 on channel 'mychannel' ===================== Installing chaincode on peer1.org2...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2020-09-24 11:04:10.365 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2020-09-24 11:04:10.365 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2020-09-24 11:04:11.184 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >
===================== Chaincode is installed on peer1.org2 ===================== Querying chaincode on peer1.org2...
===================== Querying on peer1.org2 on channel 'mychannel'... =====================
Attempting to Query peer1.org2 ...3 secs
+ peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'
^[OQ+ res=0
+ set +x90
===================== Query successful on peer1.org2 on channel 'mychannel' ===================== ========= All GOOD, BYFN execution completed =========== _____   _   _   ____
| ____| | \ | | |  _ \
|  _|   |  \| | | | | |
| |___  | |\  | | |_| |
|_____| |_| \_| |____/  

4、客户端操作
进入 cli容器

docker exec -it cli bash

查询a的余额

peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'

显示正常,结果为90

查询b的余额,为210

peer chaincode query -C mychannel -n mycc -c '{"Args":["query","b"]}'

a 向 b 转账 20 并查询各自的余额:

peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses peer0.org2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"Args":["invoke","a","b","20"]}'

执行后,查看a和b的结果,a应当是70,b应当是230

Bingo,完全正确。至此,Fabric V1.0.0Fabric V1.4.3 环境都完美搞好了。

4、first-network的关闭

关闭网络:

./byfn.sh -m down

执行 docker ps -a 可以看到 容器情况:

cuijb@cuijb-VirtualBox:~/go/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network$ docker ps -a
CONTAINER ID        IMAGE                                                                                                  COMMAND                  CREATED             STATUS              PORTS                      NAMES
b609b3d98436        dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab   "chaincode -peer.add…"   41 minutes ago      Up 41 minutes                                  dev-peer1.org2.example.com-mycc-1.0
f24c5f7fdf6b        dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9   "chaincode -peer.add…"   42 minutes ago      Up 42 minutes                                  dev-peer0.org1.example.com-mycc-1.0
eb1dbb4a9269        dev-peer0.org2.example.com-mycc-1.0-15b571b3ce849066b7ec74497da3b27e54e0df1345daff3951b94245ce09c42b   "chaincode -peer.add…"   42 minutes ago      Up 42 minutes                                  dev-peer0.org2.example.com-mycc-1.0
bad91d6708e9        hyperledger/fabric-tools:latest                                                                        "/bin/bash"              44 minutes ago      Up 43 minutes                                  cli
fde805cdd9a9        hyperledger/fabric-orderer:latest                                                                      "orderer"                44 minutes ago      Up 44 minutes       0.0.0.0:7050->7050/tcp     orderer.example.com
6d65447fb84c        hyperledger/fabric-peer:latest                                                                         "peer node start"        44 minutes ago      Up 44 minutes       0.0.0.0:9051->9051/tcp     peer0.org2.example.com
56b7e58f1374        hyperledger/fabric-peer:latest                                                                         "peer node start"        44 minutes ago      Up 44 minutes       0.0.0.0:7051->7051/tcp     peer0.org1.example.com
fb03d8e4dd2f        hyperledger/fabric-peer:latest                                                                         "peer node start"        44 minutes ago      Up 44 minutes       0.0.0.0:10051->10051/tcp   peer1.org2.example.com
96b66a7d468b        hyperledger/fabric-peer:latest                                                                         "peer node start"        44 minutes ago      Up 44 minutes       0.0.0.0:8051->8051/tcp     peer1.org1.example.com

5、注意事项

若上次启动网络后没有关闭,下次启动网络之前一定要先执行 ./byfn.sh -m down
然后再次启动网络,只需执行./byfn.sh -m up -c myfirstchannel 即可。
再次,关闭所有 docker 容器的命令(如果用得到的话):

docker rm -f $(docker ps -aq)

参考文章

https://blog.csdn.net/jambeau/article/details/103712408
https://blog.csdn.net/wwqcherry/article/details/107009909
https://www.pianshen.com/article/38761096450/

写在最后

感谢网上众多大佬的案例,我才得以成功搭建。如果你觉得这篇文章对你有所帮助,关注微信公众号半路猿,拉你进我们的学习交流群,一起学习,一同成长。

Fabric开发(三) Ubuntu20.04.1快速搭建Fabric1.4.3 (排雷版)相关推荐

  1. linux ubuntu 安装git服务器,[linux] Ubuntu20.04上安装搭建私有Git服务器Gitea

    [linux] Ubuntu20.04上安装搭建私有Git服务器Gitea [linux] Ubuntu20.04上安装搭建私有Git服务器Gitea Gitea 是相比于gitlab更加轻量化,而且 ...

  2. ROS联合Webots实现3d建图(一)Ubuntu20.04 A_LOAM环境搭建(完美运行)

    ROS联合Webots实现3d建图(一)Ubuntu20.04 A_LOAM环境搭建(完美运行) 注意: 再学习本系列教程时,应该已经安装过ROS了并且需要有一些ROS的基本知识 ubuntu版本:2 ...

  3. linux开发 stc_在Linux上快速搭建8051开发环境

    在Linux上快速搭建8051开发环境(2018-7-2) 0. 写在开始之前 实验操作系统环境: Ubuntu 16.04 编译器: sdcc SDCC - Small Device C Compi ...

  4. (三)ubuntu20.04搭建gitlab服务器

    1.安装依赖 sudo apt install ca-certificates curl openssh-server postfix 对于postfix的安装,域名后续可以更改 2.安装gitlab ...

  5. 【华为云实战开发】13.如何在云端快速搭建python网站

    1 概述 1.1 文章目的 本文主要想为研发Python项目的企业或个人提供上云指导,通过本文中的示例项目 "AI物体检测",为开发者提供包括项目管理,代码托管,代码检查,编译构建 ...

  6. 【开发篇】10分钟快速搭建React后台管理系统模板

    React后台管理系统模板 github 我又回来了!!!学完前端react,再学spring,这周或者下周写spring有关的!!! 一.准备React 1.建立react应用 npx create ...

  7. 【产品实操】三分钟教你快速搭建字符识别CNN模型

    深度学习中最令人兴奋的领域之一就是计算机视觉.通过卷积神经网络CNN(Convolutional Neural Networks),我们已经能够创建自动驾驶系统.面部检测系统和自动医学图像分析等.但如 ...

  8. Web开发day1:使用flask快速搭建网站

    目录 1. 简单跑通 2. 浏览器能识别的标签 2.1 编码(head中) 2.2 标题(head中) 2.3 标题(body中,块级标签) 2.4 div和span(body中,div块级标签,sp ...

  9. srs直播 java开发,使用 SRS/OBS/VLC 快速搭建直播服务系统

    环境准备 推流服务器 我用 SRS 运行在 Debian/Jessie 下 v2.0.209 . 编译安装 ./configure --prefix=/opt/srs --with-stat --wi ...

  10. Python+django+xadmin学习与开发笔记【04】快速开发后台管理系统

    [先试试django自带的admin] 创建superuser,但报错了..发现user表里的gender长度设置小了(female是6个字符)于是update一下这个字段,参考https://blo ...

最新文章

  1. 3.8 Softmax 回归-深度学习第二课《改善深层神经网络》-Stanford吴恩达教授
  2. UOJ #268 BZOJ 4732 [清华集训2016]数据交互 (树链剖分、线段树)
  3. 启明云端技术社区之星--张梦玉
  4. 核心期刊 CA JST CSCD 含金量_期刊评介|《仪表技术与传感器》科技期刊的阿玛尼,只管投就对了!...
  5. Java中try catch的原则
  6. 《统计学习方法》——提升算法
  7. Linux三剑客正则表达式常用字符汇总
  8. 基于汇编的 C/C++ 协程 - 背景知识
  9. android 设置组件背景图片,Android TextView背景颜色与背景图片设置
  10. 一分钟带你解读收发器指示灯以及SFP光模块搭配(二)
  11. Mellotron:Multispeaker expressive voice synthesis by conditioning on rhythm, pitch and global style
  12. python 今日头条 控制手机_Python脚本下载今日头条视频(附加Android版本辅助下载器)...
  13. fedora 16 安装firefox flash插件
  14. 记一次confluence邮件服务器配置的坑(阿里企业邮箱)
  15. 编写Java程序,使用面向接口编程模拟不同动物的吼叫声
  16. 对计算机辅助英语的看法,浅谈利用计算机辅助英语语言测试
  17. SwiftUI 音乐类App之Tuner App 调谐器适用于任何乐器支持木风 黄铜 琴弦 声音
  18. execl批量创建文件夹乱码解决方案
  19. Redis 之布隆过滤器,增强版,布谷鸟过滤器
  20. 如何编译Android的kernel,编译Android的kernel

热门文章

  1. ITOP4412----Uboot2020移植记录
  2. IDEA translation翻译插件报错-》更新TKK失败请检查网络
  3. ereg/eregi报错处理办法
  4. mysql binlog 查看pos点_如何寻找主库binlog和pos点
  5. Ubuntu16.04常用工具
  6. linux crontab零点,Linux中20个crontab例子
  7. [模拟] aw3758. 距离零点的时刻(模拟+aw周赛007_1)
  8. 复合类型(json)
  9. 修改xshell的配色方案
  10. iOS基础教程:记录从零开始到APP发布过程