在本地搭建hyperledger fabric 网络

参考了官方文档,直接就可以了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.sh Installing hyperledger/fabric-samples repo ===> Cloning hyperledger/fabric-samples repo and checkout v1.4.0
Cloning into 'fabric-samples'...
remote: Enumerating objects: , done.
remote: Counting objects: % (/), done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta ), pack-reused
Receiving objects: % (/), 1.04 MiB | 25.00 KiB/s, done.
Resolving deltas: % (/), 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-] Align fabric-samples with 1.4. release Installing Hyperledger Fabric binaries ===> Downloading version 1.4. 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 Current
Dload Upload Total Spent Left Speed
39.8M 39.8M 190k :: :: --:--:-- 254k
==> Done.
===> Downloading version 1.4. 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 Current
Dload Upload Total Spent Left Speed
4806k 4806k 161k :: :: --:--:-- 160k
==> Done. Installing Hyperledger Fabric docker images ===> Pulling fabric Images
==> FABRIC IMAGE: peer 1.4.: 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.
==> FABRIC IMAGE: orderer 1.4.: 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.
==> FABRIC IMAGE: ccenv 1.4.: 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.
==> FABRIC IMAGE: tools 1.4.: 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.
==> FABRIC IMAGE: baseos Error response from daemon: manifest for hyperledger/fabric-baseos:1.4. not found
Error response from daemon: No such image: hyperledger/fabric-baseos:1.4.
==> FABRIC IMAGE: nodeenv Error response from daemon: manifest for hyperledger/fabric-nodeenv:1.4. not found
Error response from daemon: No such image: hyperledger/fabric-nodeenv:1.4.
==> FABRIC IMAGE: javaenv 1.4.: 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.
===> Pulling fabric ca Image
==> FABRIC CA IMAGE 1.4.: 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.
===> Pulling thirdparty docker images
==> THIRDPARTY DOCKER IMAGE: couchdb 0.4.: Pulling from hyperledger/fabric-couchdb
Digest: sha256:f6c724592abf9c2b35d2f4cd6a7afcde9c1052cfed61560b20ef9e2e927d1790
Status: Downloaded newer image for hyperledger/fabric-couchdb:0.4.
==> THIRDPARTY DOCKER IMAGE: kafka 0.4.: 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.
==> THIRDPARTY DOCKER IMAGE: zookeeper 0.4.: 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. ===> List out hyperledger docker images
hyperledger/fabric-ca <none> 3a1799cda5d7 weeks ago 252MB
hyperledger/fabric-tools <none> 432c24764fbb weeks ago .55GB
hyperledger/fabric-ccenv <none> d7433c4b2a1c weeks ago .43GB
hyperledger/fabric-orderer <none> ec4ca236d3d4 weeks ago 173MB
hyperledger/fabric-peer <none> a1e3874f338b weeks ago 178MB
hyperledger/fabric-zookeeper 0.4. 20c6045930c8 weeks ago .43GB
hyperledger/fabric-zookeeper latest 20c6045930c8 weeks ago .43GB
hyperledger/fabric-kafka 0.4. b4ab82bbaf2f weeks ago .44GB
hyperledger/fabric-kafka latest b4ab82bbaf2f weeks ago .44GB
hyperledger/fabric-couchdb 0.4. 8de128a55539 weeks ago .5GB
hyperledger/fabric-couchdb latest 8de128a55539 weeks ago .5GB
hyperledger/fabric-baseos amd64-0.4. 9d6ec11c60ff weeks ago 145MB
hyperledger/fabric-baseos latest 9d6ec11c60ff weeks ago 145MB
hyperledger/fabric-javaenv 1.4. 3d91b3bf7118 months ago .75GB
hyperledger/fabric-javaenv latest 3d91b3bf7118 months ago .75GB
hyperledger/fabric-tools 1.4. 0a44f4261a55 months ago .56GB
hyperledger/fabric-tools latest 0a44f4261a55 months ago .56GB
hyperledger/fabric-ccenv 1.4. 5b31d55f5f3a months ago .43GB
hyperledger/fabric-ccenv latest 5b31d55f5f3a months ago .43GB
hyperledger/fabric-orderer 1.4. 54f372205580 months ago 150MB
hyperledger/fabric-orderer latest 54f372205580 months ago 150MB
hyperledger/fabric-peer 1.4. 304fac59b501 months ago 157MB
hyperledger/fabric-peer latest 304fac59b501 months ago 157MB
hyperledger/fabric-ca 1.4. 1a804ab74f58 months ago 244MB
hyperledger/fabric-ca latest 1a804ab74f58 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.
-c <channel name> - channel name to use (defaults to "mychannel")
-t <timeout> - CLI timeout duration in seconds (defaults to )
-d <delay> - delay duration in seconds (defaults to )
-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 mode
byfn.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 mychannel
byfn.sh up -c mychannel -s couchdb
byfn.sh up -c mychannel -s couchdb -i 1.4.
byfn.sh up -l node
byfn.sh down -c mychannel
byfn.sh upgrade -c mychannel Taking all defaults:
byfn.sh generate
byfn.sh up
byfn.sh down
➜ first-network git:(bb39b6e) ./byfn.sh generate
Generating certs and genesis block for channel 'mychannel' with CLI timeout of '' seconds and CLI delay of '' 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=
+ 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
-- ::24.844 CST [common.tools.configtxgen] main -> INFO Loading configuration
-- ::24.885 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO orderer type: solo
-- ::24.885 CST [common.tools.configtxgen.localconfig] Load -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::24.929 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO orderer type: solo
-- ::24.929 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::24.932 CST [common.tools.configtxgen] doOutputBlock -> INFO Generating genesis block
-- ::24.933 CST [common.tools.configtxgen] doOutputBlock -> INFO Writing genesis block
+ res=
+ set +x #################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
-- ::24.986 CST [common.tools.configtxgen] main -> INFO Loading configuration
-- ::25.027 CST [common.tools.configtxgen.localconfig] Load -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::25.061 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO orderer type: solo
-- ::25.061 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::25.061 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO Generating new channel configtx
-- ::25.064 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO Writing new channel tx
+ res=
+ set +x #################################################################
####### Generating anchor peer update for Org1MSP ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
-- ::25.132 CST [common.tools.configtxgen] main -> INFO Loading configuration
-- ::25.174 CST [common.tools.configtxgen.localconfig] Load -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::25.212 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO orderer type: solo
-- ::25.212 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::25.212 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO Generating anchor peer update
-- ::25.214 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO Writing anchor peer update
+ res=
+ set +x #################################################################
####### Generating anchor peer update for Org2MSP ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
-- ::25.267 CST [common.tools.configtxgen] main -> INFO Loading configuration
-- ::25.304 CST [common.tools.configtxgen.localconfig] Load -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::25.341 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO orderer type: solo
-- ::25.342 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO Loaded configuration: /Volumes/Data/Work/golang/src/github.com/hyperledger/fabric/scripts/fabric-samples/first-network/configtx.yaml
-- ::25.342 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO Generating anchor peer update
-- ::25.342 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO Writing anchor peer update
+ res=
+ set +x ➜ first-network git:(bb39b6e) ./byfn.sh up
Starting for channel 'mychannel' with CLI timeout of '' seconds and CLI delay of '' seconds
Continue? [Y/n] y
proceeding ...
LOCAL_VERSION=1.4.
DOCKER_IMAGE_VERSION=1.4.
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 test Channel name : mychannel
Creating channel...
+ peer channel create -o orderer.example.com: -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=
+ set +x
-- ::58.550 UTC [channelCmd] InitCmdFactory -> INFO Endorser and orderer connections initialized
-- ::58.646 UTC [cli.common] readBlock -> INFO Received block:
===================== Channel 'mychannel' created ===================== Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=
+ set +x
-- ::58.821 UTC [channelCmd] InitCmdFactory -> INFO Endorser and orderer connections initialized
-- ::58.905 UTC [channelCmd] executeJoin -> INFO Successfully submitted proposal to join channel
===================== peer0.org1 joined channel 'mychannel' ===================== + peer channel join -b mychannel.block
+ res=
+ set +x
-- ::02.111 UTC [channelCmd] InitCmdFactory -> INFO Endorser and orderer connections initialized
-- ::02.197 UTC [channelCmd] executeJoin -> INFO Successfully submitted proposal to join channel
===================== peer1.org1 joined channel 'mychannel' ===================== + peer channel join -b mychannel.block
+ res=
+ set +x
-- ::05.360 UTC [channelCmd] InitCmdFactory -> INFO Endorser and orderer connections initialized
-- ::05.437 UTC [channelCmd] executeJoin -> INFO Successfully submitted proposal to join channel
===================== peer0.org2 joined channel 'mychannel' ===================== + peer channel join -b mychannel.block
+ res=
+ set +x
-- ::08.580 UTC [channelCmd] InitCmdFactory -> INFO Endorser and orderer connections initialized
-- ::08.656 UTC [channelCmd] executeJoin -> INFO Successfully submitted proposal to join channel
===================== peer1.org2 joined channel 'mychannel' ===================== Updating anchor peers for org1...
+ peer channel update -o orderer.example.com: -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=
+ set +x
-- ::11.815 UTC [channelCmd] InitCmdFactory -> INFO Endorser and orderer connections initialized
-- ::11.849 UTC [channelCmd] update -> INFO 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: -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=
+ set +x
-- ::15.029 UTC [channelCmd] InitCmdFactory -> INFO Endorser and orderer connections initialized
-- ::15.065 UTC [channelCmd] update -> INFO 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=
+ set +x
-- ::18.265 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO Using default escc
-- ::18.265 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO Using default vscc
-- ::19.176 UTC [chaincodeCmd] install -> INFO Installed remotely response:<status: 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=
+ set +x
-- ::19.414 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO Using default escc
-- ::19.415 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO Using default vscc
-- ::19.697 UTC [chaincodeCmd] install -> INFO Installed remotely response:<status: payload:"OK" >
===================== Chaincode is installed on peer0.org2 ===================== Instantiating chaincode on peer0.org2...
+ peer chaincode instantiate -o orderer.example.com: --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=
+ set +x
-- ::19.900 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO Using default escc
-- ::19.901 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 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 ... secs
+ res=
+ set +x ===================== Query successful on peer0.org1 on channel 'mychannel' =====================
Sending invoke transaction on peer0.org1 peer0.org2...
+ peer chaincode invoke -o orderer.example.com: --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: --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: --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=
+ set +x
-- ::25.793 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO Chaincode invoke successful. result: status:
===================== 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=
+ set +x
-- ::25.945 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO Using default escc
-- ::25.945 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO Using default vscc
-- ::26.280 UTC [chaincodeCmd] install -> INFO Installed remotely response:<status: 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 ... secs
+ res=
+ set +x ===================== Query successful on peer1.org2 on channel 'mychannel' ===================== ========= All GOOD, BYFN execution completed =========== _____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/
上一篇:Ubuntu16.04下安装Hyperledger Fabric 1.0.0


下一篇:ASP.NET ashx实现无刷新页面生成验证码