参考了官方文档,直接就可以了https://hyperledger-fabric.readthedocs.io/en/latest/build_network.html 很好用

➜  ~ cd $GOPATH/src/github.com/hyperledger/fabric/master/scripts/
cd: no such file or directory: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/master/scripts/
➜  ~ cd $GOPATH/src/github.com/hyperledger/fabric/scripts
➜  scripts git:(be235fd3a) ✗ ls
bootstrap.sh             check_go_version.sh      check_trailingspaces.sh  goListFiles.sh           multiarch.sh             run-unit-tests.sh
changelog.sh             check_license.sh         compile_protos.sh        golinter.sh              pull_build_artifacts.sh
check_deps.sh            check_spelling.sh        generateHelpDocs.sh      metrics_doc.sh           run-integration-tests.sh
➜  scripts git:(be235fd3a) ✗ ./bootstrap.shInstalling hyperledger/fabric-samples repo===> Cloning hyperledger/fabric-samples repo and checkout v1.4.0
Cloning into 'fabric-samples'...
remote: Enumerating objects: 43, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 3140 (delta 13), reused 32 (delta 11), pack-reused 3097
Receiving objects: 100% (3140/3140), 1.04 MiB | 25.00 KiB/s, done.
Resolving deltas: 100% (1528/1528), done.
Note: checking out 'v1.4.0'.You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:git checkout -b <new-branch-name>HEAD is now at bb39b6e [FAB-13570] Align fabric-samples with 1.4.0 releaseInstalling Hyperledger Fabric binaries===> Downloading version 1.4.0 platform specific fabric binaries
===> Downloading:  https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/darwin-amd64-1.4.0/hyperledger-fabric-darwin-amd64-1.4.0.tar.gz% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100 39.8M  100 39.8M    0     0   190k      0  0:03:34  0:03:34 --:--:--  254k
==> Done.
===> Downloading version 1.4.0 platform specific fabric-ca-client binary
===> Downloading:  https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/darwin-amd64-1.4.0/hyperledger-fabric-ca-darwin-amd64-1.4.0.tar.gz% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100 4806k  100 4806k    0     0   161k      0  0:00:29  0:00:29 --:--:--  160k
==> Done.Installing Hyperledger Fabric docker images===> Pulling fabric Images
==> FABRIC IMAGE: peer1.4.0: Pulling from hyperledger/fabric-peer
3b37166ec614: Pull complete
504facff238f: Pull complete
ebbcacd28e10: Pull complete
c7fb3351ecad: Pull complete
2e3debadcbf7: Pull complete
fc435e46e32e: Pull complete
a4922bafdce8: Pull complete
7d9964965066: Pull complete
625153a09c48: Pull complete
291344806a10: Pull complete
Digest: sha256:9707c97f787de1d4d6dd60994d6b8ea2e5cc28b0f42e6849df3fb41c64b41372
Status: Downloaded newer image for hyperledger/fabric-peer:1.4.0
==> FABRIC IMAGE: orderer1.4.0: Pulling from hyperledger/fabric-orderer
3b37166ec614: Already exists
504facff238f: Already exists
ebbcacd28e10: Already exists
c7fb3351ecad: Already exists
2e3debadcbf7: Already exists
fc435e46e32e: Already exists
a4922bafdce8: Already exists
7d9964965066: Already exists
1aa1f5822ea4: Pull complete
f3adcb95411e: Pull complete
Digest: sha256:644265186b4887c7d9dcb91895124ccead3c0125c2c4f9eadc421dc9555d7495
Status: Downloaded newer image for hyperledger/fabric-orderer:1.4.0
==> FABRIC IMAGE: ccenv1.4.0: Pulling from hyperledger/fabric-ccenv
3b37166ec614: Already exists
504facff238f: Already exists
ebbcacd28e10: Already exists
c7fb3351ecad: Already exists
2e3debadcbf7: Already exists
fc435e46e32e: Already exists
a4922bafdce8: Already exists
14675a1189ca: Pull complete
33f930d7053e: Pull complete
7aa21e006739: Pull complete
806ba27e29bb: Pull complete
0292b0ff822a: Pull complete
5d4ce0f5fd82: Pull complete
3bde20c14104: Pull complete
Digest: sha256:6d797cac9fd39d4c9964fbcf02e47137ce8ae321af60832c41d511f0c7ed4d3e
Status: Downloaded newer image for hyperledger/fabric-ccenv:1.4.0
==> FABRIC IMAGE: tools1.4.0: Pulling from hyperledger/fabric-tools
3b37166ec614: Already exists
504facff238f: Already exists
ebbcacd28e10: Already exists
c7fb3351ecad: Already exists
2e3debadcbf7: Already exists
fc435e46e32e: Already exists
a4922bafdce8: Already exists
14675a1189ca: Already exists
33f930d7053e: Already exists
7aa21e006739: Already exists
806ba27e29bb: Already exists
72b2b3c78600: Pull complete
f36a6f470154: Pull complete
19fc6d1044df: Pull complete
Digest: sha256:aee256916d0cb938d8023fa32ed2745991d32cfe79018e360f1720707ebfbdb5
Status: Downloaded newer image for hyperledger/fabric-tools:1.4.0
==> FABRIC IMAGE: baseosError response from daemon: manifest for hyperledger/fabric-baseos:1.4.0 not found
Error response from daemon: No such image: hyperledger/fabric-baseos:1.4.0
==> FABRIC IMAGE: nodeenvError response from daemon: manifest for hyperledger/fabric-nodeenv:1.4.0 not found
Error response from daemon: No such image: hyperledger/fabric-nodeenv:1.4.0
==> FABRIC IMAGE: javaenv1.4.0: Pulling from hyperledger/fabric-javaenv
3b37166ec614: Already exists
504facff238f: Already exists
ebbcacd28e10: Already exists
c7fb3351ecad: Already exists
2e3debadcbf7: Already exists
fc435e46e32e: Already exists
a4922bafdce8: Already exists
14675a1189ca: Already exists
33f930d7053e: Already exists
7aa21e006739: Already exists
806ba27e29bb: Already exists
af7eebe5d909: Pulling fs layer
c0ad74369a8f: Pulling fs layer
e36a0232c697: Pulling fs layer
c44da90e9317: Pull complete
91686ed50f7f: Pull complete
1bc0e6d0fb0f: Pull complete
db373eca3e52: Pull complete
942e34fe9650: Pull complete
e49b8e9d853d: Pull complete
094ba7d3af94: Pull complete
4bf56bdf76e0: Pull complete
138eeaa643a0: Pull complete
2b405cbef2dc: Pull complete
386086ff2840: Pull complete
32bb4435cb82: Pull complete
3280cfa711dc: Pull complete
6b14cff5081c: Pull complete
04743de5a814: Pull complete
5360864ccda4: Pull complete
2fd4fc8d8137: Pull complete
bd0e3b20a1bb: Pull complete
a298ecbfeab2: Pull complete
c7b9277c5a65: Pull complete
201919c3a1fe: Pull complete
539bfc561087: Pull complete
4e779849c7ea: Pull complete
3a7304a5b624: Pull complete
Digest: sha256:f392f0c568e515b3e14c9afce14340ba18bc456cfd831ffcb4f72db58dbbcc34
Status: Downloaded newer image for hyperledger/fabric-javaenv:1.4.0
===> Pulling fabric ca Image
==> FABRIC CA IMAGE1.4.0: Pulling from hyperledger/fabric-ca
3b37166ec614: Already exists
504facff238f: Already exists
ebbcacd28e10: Already exists
c7fb3351ecad: Already exists
2e3debadcbf7: Already exists
fc435e46e32e: Already exists
a4922bafdce8: Already exists
c8ec0cae397c: Pull complete
3153e2e7116e: Pull complete
d84abf263d15: Pull complete
45ff112943d3: Pull complete
c4678d50bc7a: Pull complete
Digest: sha256:c1dce534d9e9202697e0aaad7c5521d958700fda0b05127dafb9333c22e15f74
Status: Downloaded newer image for hyperledger/fabric-ca:1.4.0
===> Pulling thirdparty docker images
==> THIRDPARTY DOCKER IMAGE: couchdb0.4.15: Pulling from hyperledger/fabric-couchdb
Digest: sha256:f6c724592abf9c2b35d2f4cd6a7afcde9c1052cfed61560b20ef9e2e927d1790
Status: Downloaded newer image for hyperledger/fabric-couchdb:0.4.15
==> THIRDPARTY DOCKER IMAGE: kafka0.4.15: Pulling from hyperledger/fabric-kafka
34667c7e4631: Already exists
d18d76a881a4: Already exists
119c7358fbfc: Already exists
2aaf13f3eff0: Already exists
3f89de4cf84b: Already exists
24194f819972: Already exists
78e4eabd31a5: Already exists
c7652b6bde40: Already exists
b4646dd65c45: Already exists
5e6defad8a30: Already exists
d0459116a54a: Pull complete
1bbcec7bfdef: Pull complete
5911218c5933: Pull complete
Digest: sha256:62418a885c291830510379d9eb09fbdd3d397052d916ed877a468b0e2026b9e3
Status: Downloaded newer image for hyperledger/fabric-kafka:0.4.15
==> THIRDPARTY DOCKER IMAGE: zookeeper0.4.15: Pulling from hyperledger/fabric-zookeeper
34667c7e4631: Already exists
d18d76a881a4: Already exists
119c7358fbfc: Already exists
2aaf13f3eff0: Already exists
3f89de4cf84b: Already exists
24194f819972: Already exists
78e4eabd31a5: Already exists
c7652b6bde40: Already exists
b4646dd65c45: Already exists
5e6defad8a30: Already exists
0e045d9c2cdc: Pull complete
7ef4d8920518: Pull complete
dbeed81d9a45: Pull complete
aeea025ecc4e: Pull complete
Digest: sha256:180553e88d09167370aa62a41587a9a95b819b981ad74cad218689412b85f130
Status: Downloaded newer image for hyperledger/fabric-zookeeper:0.4.15===> List out hyperledger docker images
hyperledger/fabric-ca                                                                                  <none>              3a1799cda5d7        4 weeks ago         252MB
hyperledger/fabric-tools                                                                               <none>              432c24764fbb        4 weeks ago         1.55GB
hyperledger/fabric-ccenv                                                                               <none>              d7433c4b2a1c        4 weeks ago         1.43GB
hyperledger/fabric-orderer                                                                             <none>              ec4ca236d3d4        4 weeks ago         173MB
hyperledger/fabric-peer                                                                                <none>              a1e3874f338b        4 weeks ago         178MB
hyperledger/fabric-zookeeper                                                                           0.4.15              20c6045930c8        7 weeks ago         1.43GB
hyperledger/fabric-zookeeper                                                                           latest              20c6045930c8        7 weeks ago         1.43GB
hyperledger/fabric-kafka                                                                               0.4.15              b4ab82bbaf2f        7 weeks ago         1.44GB
hyperledger/fabric-kafka                                                                               latest              b4ab82bbaf2f        7 weeks ago         1.44GB
hyperledger/fabric-couchdb                                                                             0.4.15              8de128a55539        7 weeks ago         1.5GB
hyperledger/fabric-couchdb                                                                             latest              8de128a55539        7 weeks ago         1.5GB
hyperledger/fabric-baseos                                                                              amd64-0.4.15        9d6ec11c60ff        7 weeks ago         145MB
hyperledger/fabric-baseos                                                                              latest              9d6ec11c60ff        7 weeks ago         145MB
hyperledger/fabric-javaenv                                                                             1.4.0               3d91b3bf7118        3 months ago        1.75GB
hyperledger/fabric-javaenv                                                                             latest              3d91b3bf7118        3 months ago        1.75GB
hyperledger/fabric-tools                                                                               1.4.0               0a44f4261a55        4 months ago        1.56GB
hyperledger/fabric-tools                                                                               latest              0a44f4261a55        4 months ago        1.56GB
hyperledger/fabric-ccenv                                                                               1.4.0               5b31d55f5f3a        4 months ago        1.43GB
hyperledger/fabric-ccenv                                                                               latest              5b31d55f5f3a        4 months ago        1.43GB
hyperledger/fabric-orderer                                                                             1.4.0               54f372205580        4 months ago        150MB
hyperledger/fabric-orderer                                                                             latest              54f372205580        4 months ago        150MB
hyperledger/fabric-peer                                                                                1.4.0               304fac59b501        4 months ago        157MB
hyperledger/fabric-peer                                                                                latest              304fac59b501        4 months ago        157MB
hyperledger/fabric-ca                                                                                  1.4.0               1a804ab74f58        4 months ago        244MB
hyperledger/fabric-ca                                                                                  latest              1a804ab74f58        4 months ago        244MB
➜  scripts git:(be235fd3a) ✗ ls
bootstrap.sh             check_go_version.sh      check_trailingspaces.sh  generateHelpDocs.sh      metrics_doc.sh           run-integration-tests.sh
changelog.sh             check_license.sh         compile_protos.sh        goListFiles.sh           multiarch.sh             run-unit-tests.sh
check_deps.sh            check_spelling.sh        fabric-samples           golinter.sh              pull_build_artifacts.sh
➜  scripts git:(be235fd3a) ✗ cd fabric-samples
➜  fabric-samples git:(bb39b6e) ls
CODE_OF_CONDUCT.md       LICENSE                  balance-transfer         chaincode                config                   high-throughput
CONTRIBUTING.md          MAINTAINERS.md           basic-network            chaincode-docker-devmode fabcar                   interest_rate_swaps
Jenkinsfile              README.md                bin                      commercial-paper         first-network            scripts
➜  fabric-samples git:(bb39b6e)
➜  fabric-samples git:(bb39b6e)
➜  fabric-samples git:(bb39b6e) ls
CODE_OF_CONDUCT.md       LICENSE                  balance-transfer         chaincode                config                   high-throughput
CONTRIBUTING.md          MAINTAINERS.md           basic-network            chaincode-docker-devmode fabcar                   interest_rate_swaps
Jenkinsfile              README.md                bin                      commercial-paper         first-network            scripts
➜  fabric-samples git:(bb39b6e) cd first-network
➜  first-network git:(bb39b6e) ls
README.md                        channel-artifacts                docker-compose-cli.yaml          docker-compose-e2e-template.yaml eyfn.sh
base                             configtx.yaml                    docker-compose-couch-org3.yaml   docker-compose-kafka.yaml        org3-artifacts
byfn.sh                          crypto-config.yaml               docker-compose-couch.yaml        docker-compose-org3.yaml         scripts
➜  first-network git:(bb39b6e) ./byfn.sh
Usage:byfn.sh <mode> [-c <channel name>] [-t <timeout>] [-d <delay>] [-f <docker-compose-file>] [-s <dbtype>] [-l <language>] [-o <consensus-type>] [-i <imagetag>] [-v]<mode> - one of 'up', 'down', 'restart', 'generate' or 'upgrade'- 'up' - bring up the network with docker-compose up- 'down' - clear the network with docker-compose down- 'restart' - restart the network- 'generate' - generate required certificates and genesis block- 'upgrade'  - upgrade the network from version 1.3.x to 1.4.0-c <channel name> - channel name to use (defaults to "mychannel")-t <timeout> - CLI timeout duration in seconds (defaults to 10)-d <delay> - delay duration in seconds (defaults to 3)-f <docker-compose-file> - specify which docker-compose file use (defaults to docker-compose-cli.yaml)-s <dbtype> - the database backend to use: goleveldb (default) or couchdb-l <language> - the chaincode language: golang (default) or node-o <consensus-type> - the consensus-type of the ordering service: solo (default) or kafka-i <imagetag> - the tag to be used to launch the network (defaults to "latest")-v - verbose modebyfn.sh -h (print this message)Typically, one would first generate the required certificates and
genesis block, then bring up the network. e.g.:byfn.sh generate -c mychannelbyfn.sh up -c mychannel -s couchdbbyfn.sh up -c mychannel -s couchdb -i 1.4.0byfn.sh up -l nodebyfn.sh down -c mychannelbyfn.sh upgrade -c mychannelTaking all defaults:byfn.sh generatebyfn.sh upbyfn.sh down
➜  first-network git:(bb39b6e) ./byfn.sh generate
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 ...
/Volumes/Data/Work/golang/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 +x/Volumes/Data/Work/golang/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
2019-05-11 09:39:24.844 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-05-11 09:39:24.885 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: solo
2019-05-11 09:39:24.885 CST [common.tools.configtxgen.localconfig] Load -> INFO 003 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:24.929 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 004 orderer type: solo
2019-05-11 09:39:24.929 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 005 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:24.932 CST [common.tools.configtxgen] doOutputBlock -> INFO 006 Generating genesis block
2019-05-11 09:39:24.933 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
2019-05-11 09:39:24.986 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-05-11 09:39:25.027 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:25.061 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-05-11 09:39:25.061 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:25.061 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 005 Generating new channel configtx
2019-05-11 09:39:25.064 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
2019-05-11 09:39:25.132 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-05-11 09:39:25.174 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:25.212 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-05-11 09:39:25.212 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:25.212 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-05-11 09:39:25.214 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
2019-05-11 09:39:25.267 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-05-11 09:39:25.304 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:25.341 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-05-11 09:39:25.342 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
2019-05-11 09:39:25.342 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-05-11 09:39:25.342 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 Writing anchor peer update
+ res=0
+ set +x➜  first-network git:(bb39b6e) ./byfn.sh up
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] y
proceeding ...
LOCAL_VERSION=1.4.0
DOCKER_IMAGE_VERSION=1.4.0
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
Creating peer1.org1.example.com ... done
Creating peer1.org2.example.com ... done
Creating orderer.example.com    ... done
Creating peer0.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating cli                    ... done____    _____      _      ____    _____
/ ___|  |_   _|    / \    |  _ \  |_   _|
\___ \    | |     / _ \   | |_) |   | |___) |   | |    / ___ \  |  _ <    | |
|____/    |_|   /_/   \_\ |_| \_\   |_|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
2019-05-11 01:39:58.550 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-05-11 01:39:58.646 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
2019-05-11 01:39:58.821 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-05-11 01:39:58.905 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
2019-05-11 01:40:02.111 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-05-11 01:40:02.197 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
2019-05-11 01:40:05.360 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-05-11 01:40:05.437 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
2019-05-11 01:40:08.580 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-05-11 01:40:08.656 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
2019-05-11 01:40:11.815 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-05-11 01:40:11.849 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
2019-05-11 01:40:15.029 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-05-11 01:40:15.065 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
2019-05-11 01:40:18.265 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-05-11 01:40:18.265 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-05-11 01:40:19.176 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
2019-05-11 01:40:19.414 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-05-11 01:40:19.415 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-05-11 01:40:19.697 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
2019-05-11 01:40:19.900 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-05-11 01:40:19.901 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'... =====================
+ peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'
Attempting to Query peer0.org1 ...3 secs
+ 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:7051 --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
2019-05-11 01:40:25.793 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
2019-05-11 01:40:25.945 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-05-11 01:40:25.945 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-05-11 01:40:26.280 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'... =====================
+ peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'
Attempting to Query peer1.org2 ...3 secs
+ res=0
+ set +x90
===================== Query successful on peer1.org2 on channel 'mychannel' ============================== All GOOD, BYFN execution completed ===========_____   _   _   ____
| ____| | \ | | |  _ \
|  _|   |  \| | | | | |
| |___  | |\  | | |_| |
|_____| |_| \_| |____/

转载于:https://www.cnblogs.com/jackluo/p/10847770.html

在本地搭建hyperledger fabric 网络相关推荐

  1. 搭建Hyperledger Fabric网络

    注意:进行本文操作的前提是已完成Hyperledger Fabric的开发环境搭建,具体搭建步骤可参考[Hyperledger Fabric开发环境搭建(https://blog.csdn.net/y ...

  2. hyperledger fabric 网络操作基本操作和概念

    hyperledger fabric 网络操作基本操作和概念 hyperledger fabric 网络操作基本操作和概念 1. cryptogen 操作 1.1 cryptogen 生成证书文件 1 ...

  3. (Fabric 超级账本学习【5】)Fabric2.4网络环境下——搭建Hyperledger Fabric区块链浏览器

    博主最近在搭建Hyperledger Fabric区块链浏览器过程中也学习了很多博主的搭建流程,踩了很多雷,踩 了很多坑,现将成功搭建好的Hyperledger Fabric区块链浏览器详细流程分享如 ...

  4. Hyperledger Fabric网络环境手动配置及其链码自动化部署

    目录 5.1 网络环境的搭建 5.1.1 生成组织结构与身份证书 5.1.2 生成创世区块和通道 5.1.3 启动Fabric网络 5.1.4  创建Fabric-SDK-GO对象并建立通道 5.1. ...

  5. Linux搭建Hyperledger Fabric区块链框架 - Hyperledger Fabric模型概念

    企业选型的区块链底层技术 Hyperledger Fabric 概念 2015年,Linux基金会启动了Hyperledger项目,目标是发展跨行业的区块链技术. Hyperledger Fabric ...

  6. 在一台Ubuntu计算机上构建Hyperledger Fabric网络

    在一台Ubuntu计算机上构建Hyperledger Fabric网络 Hyperledger fabric是一个开源的区块链应用程序平台,为开发基于区块链的应用程序提供了一个起点.当我们提到Hype ...

  7. 基于Debian搭建Hyperledger Fabric 2.4开发环境及运行简单案例

    前言 在基于truffle框架实现以太坊公开拍卖智能合约中我们已经实现了以太坊智能合约的编写及部署,但其工作方式注定其只能应用于有限的业务场景中.相比之下,基于超级账本的Fabric具有高可扩展性和高 ...

  8. zookeeper 虚拟机搭建好后 外部链接不上_Ubuntu Server搭建Hyperledger Fabric 2.1学习环境...

    最近在学习Hyperledger Fabric,它是由 Linux 基金会发起创建的开源区块链分布式账本. Hyperledger Fabric是一个开源区块链实现,开发环境建立在 VirtualBo ...

  9. ubuntu18.04 快速搭建 Hyperledger Fabric超级账本框架

    这两天一直再配Hyperledger Fabric1.4的环境,找了很多资料,期间因为墙的原因找了很多博客的解决办法终于搭建成果,特此记录下来避免以后搭建出错. 文章目录 环境 步骤 1. ubunt ...

  10. Hyperledger Fabric 网络环境的一点理解

    Hyperledger Fabric 开发链码,一般都是测试网络开发,然后部署到生产网络. 下面介绍测试网络.生产网络的一点理解. 1 测试网络 使用cryptogen等工具建立测试网络,开发环境使用 ...

最新文章

  1. 流媒体服务器开发笔记(2)--RTCP协议介绍
  2. 计算机硬盘位显示none,开机找不到硬盘Detecting Primary Master... None
  3. webrtc 语音流java_通过WebView WebRTC从麦克风传输语音时的语音识别
  4. web安全_皮卡丘_csrf
  5. JDBC 数据库连接操作——实习第三天
  6. 《天天数学》连载14:一月十四日
  7. 如何解决 Nginx 端口映射到外网后访问地址端口丢失的问题
  8. [转载] python 语言基础 - 字符串常用函数及操作
  9. 在github上实现页面托管预览功能
  10. 如果有因果报应和轮回,又是怎么管理的?
  11. mock.js那点事(上)
  12. android地图偏移谷歌中国地图偏移校正补丁,关于谷歌地图GPS偏移问题的解决办法...
  13. cmd 文本文件分割_通过split命令分割大文件
  14. Makefile 编写教程(由简至难)
  15. ERP系统成本计算方法大揭秘?
  16. MAC系统中快速切换输入法的方法
  17. 高一下学期计算机考试知识点,高一年级信息技术期末考试复习题
  18. 我们向印度人学习什么?
  19. 这届90后女博士,对30岁不屑一顾
  20. tag untag pvid 理解

热门文章

  1. Linux下python执行Killed
  2. python数组初始化_python怎么初始化数组
  3. python 封装_Python之封装
  4. c语言上机作业题及答案,2017计算机二级C语言上机测试题附答案
  5. IDEA中.properties配置文件输入中文显示Unicode编码,本地编辑器,服务器打开显示Unicode编码问题解决方案
  6. python常规异常的基类_python常见异常内容
  7. 3.4选择性嵌入服务容器
  8. 【渝粤题库】陕西师范大学800002 地球概论
  9. 【sklearn第十六讲】集成方法
  10. ubuntu16.04下ROS操作系统学习笔记(五)gazebo物理仿真环境搭建、加载服务端模型数据减少报错