Você está na página 1de 11

Installing the pre-requisites

PS: All these have been tried on Ubuntu 18.04 (64-bit) with a generic kernel version
4.15.0.

1. Install docker from the https://docs.docker.com/install/linux/docker-ce/ubuntu/#upgrade-


docker-ce
2. Install docker-compose: sudo apt-get install docker-compose
3. Stay in ‘sudo’ mode: sudo su
4. Download ‘Go’ from: https://golang.org/dl/ (Choose the recent for Linux)
5. Once downloaded place the archive in the HOME directory and issue the command from
the terminal: sudo tar -C /usr/local/ -xzf go1.11.linux-amd64.tar.gz
6. Edit ~/.profile and append the lines export PATH=$PATH:/usr/local/go/bin and
export GOPATH=$HOME/go
7. Issue command: source ~/.profile
8. Install npm using: sudo apt-get install npm
9. Once the installation is done update npm using the command: npm install npm@5.6.0
-g

10. For python2.7 issue the command: sudo apt-get install python and check the
version using python --version (This should outout something like: Python
2.7.15rc1)
Obtain the sample, binaries and docker-images
1. If you are inside some local subnet with an institute proxy the first thing you need to do is
configure the proxy for docker (Note: All those who are not behind a proxy need not
to go through these steps)
a. Edit the /etc/default/docker and append the lines (here x.x.x.x:yyyy is the
respective ip:port of the institute proxy):
export http_proxy="http://x.x.x.x:yyyy/"
export https_proxy="https://x.x.x.x:yyyy/”
export ftp_proxy="ftp://x.x.x.x:yyyy/"
export socks_proxy="socks://x.x.x.x:yyyy/"
b. Then,
i. service docker restart
ii. mkdir /etc/systemd/system/docker.service.d
iii. Edit /etc/systemd/system/docker.service.d/http_proxy.conf
and append the lines:
[Service]
Environment="HTTP_PROXY=http://x.x.x.x:yyyy/"
Environment="NO_PROXY=localhost,127.0.0.0/8,10.*,docker-
registry.somecorporation.com"
iv. systemctl daemon-reload
v. systemctl show --property Environment docker (This should the
properties you have set in the file:
/etc/systemd/system/docker.service.d/http_proxy.conf)
vi. systemctl restart docker
2. Please ensure that curl is having the latest version and then run the following
command:
a. curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0 1.2.0 0.4.10
b. This will take some time and you will see logs like the following:
root@####:/home/#####/fabric-samples# curl -sSL http://bit.ly/2ysbOFE | bash -s 1.2.0 1.2.0 0.4.10

Installing hyperledger/fabric-samples repo

===> Cloning hyperledger/fabric-samples repo and checkout v1.2.0


Cloning into 'fabric-samples'...
remote: Counting objects: 1793, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 1793 (delta 2), reused 24 (delta 1), pack-reused 1767
Receiving objects: 100% (1793/1793), 624.41 KiB | 125.00 KiB/s, done.
Resolving deltas: 100% (866/866), done.
Note: checking out 'v1.2.0'.
.
.
.
.

% Total % Received % Xferd Average Speed Time Time Time Current


Dload Upload Total Spent Left Speed
100 4940k 100 4940k 0 0 893k 0 0:00:05 0:00:05 --:--:-- 1039k
==> Done.

c. And at the end:

===> List out hyperledger docker images


hyperledger/fabric-ca 1.2.0 66cc132bd09c 2 months ago
252MB
hyperledger/fabric-ca latest 66cc132bd09c 2 months ago
252MB
hyperledger/fabric-tools 1.2.0 379602873003 2 months ago
1.51GB
hyperledger/fabric-tools latest 379602873003 2 months ago
1.51GB
hyperledger/fabric-ccenv 1.2.0 6acf31e2d9a4 2 months ago
1.43GB
hyperledger/fabric-ccenv latest 6acf31e2d9a4 2 months ago
1.43GB
hyperledger/fabric-orderer 1.2.0 4baf7789a8ec 2 months ago
152MB
hyperledger/fabric-orderer latest 4baf7789a8ec 2 months ago
152MB
hyperledger/fabric-peer 1.2.0 82c262e65984 2 months ago
159MB
hyperledger/fabric-peer latest 82c262e65984 2 months ago
159MB
hyperledger/fabric-zookeeper 0.4.10 2b51158f3898 2 months ago
1.44GB
hyperledger/fabric-zookeeper latest 2b51158f3898 2 months ago
1.44GB
hyperledger/fabric-kafka 0.4.10 936aef6db0e6 2 months ago
1.45GB
hyperledger/fabric-kafka latest 936aef6db0e6 2 months ago
1.45GB
hyperledger/fabric-couchdb 0.4.10 3092eca241fc 2 months ago
1.61GB
hyperledger/fabric-couchdb latest 3092eca241fc 2 months ago 1.61GB
3. Edit ~/.profile and append the lines export PATH=$PATH:/home/<downloaded-
fabric-folder>/bin and then issue the command: source ~/.profile
4. Important Docker commands (if you have not mentioned docker for user access,
run all these commands in sudo mode only):
a. Start a ubuntu docker with bash shell: docker run -t -i --name
container1 ubuntu /bin/bash
b. View docker info: docker info
c. View all available active docker in a node: docker ps
d. View all dead/inactive docker: docker ps -all
e. Remove a docker container: docker rm container2
f. See the full information for a container: docker inspect <container id>
g. Delete images from docker: docker rmi <image_id>
h. Delete all images from docker: docker rmi $(docker images -q) (Add --
force to both of the above commands if docker throws an error for being
associated with stopped containers)
i. Bring Running Docker in Foreground: docker attach contain_id
j. Send Docker to detach mode: Ctrl-P Ctrl-Q to detach without killing the
contain
k. To run a self build image as a container:
docker run -i -t <image_id> /bin/bash
l. To run a container with port exposed:
docker run -p <exposed_port>:<self_port> -i -t <image_id>
/bin/bash
5. Now, if you issue the command:

root@####:/home/######/fabric-samples# docker images


REPOSITORY TAG IMAGE ID CREATED
SIZE
hyperledger/fabric-ca 1.2.0 66cc132bd09c 2 months ago
252MB
hyperledger/fabric-ca latest 66cc132bd09c 2 months ago
252MB
hyperledger/fabric-tools 1.2.0 379602873003 2 months ago
1.51GB
hyperledger/fabric-tools latest 379602873003 2 months ago
1.51GB
hyperledger/fabric-ccenv 1.2.0 6acf31e2d9a4 2 months ago
1.43GB
hyperledger/fabric-ccenv latest 6acf31e2d9a4 2 months ago
1.43GB
hyperledger/fabric-orderer 1.2.0 4baf7789a8ec 2 months ago
152MB
hyperledger/fabric-orderer latest 4baf7789a8ec 2 months ago
152MB
hyperledger/fabric-peer 1.2.0 82c262e65984 2 months ago
159MB
hyperledger/fabric-peer latest 82c262e65984 2 months ago
159MB
hyperledger/fabric-zookeeper 0.4.10 2b51158f3898 2 months ago
1.44GB
hyperledger/fabric-zookeeper latest 2b51158f3898 2 months ago
1.44GB
hyperledger/fabric-kafka 0.4.10 936aef6db0e6 2 months ago
1.45GB
hyperledger/fabric-kafka latest 936aef6db0e6 2 months ago
1.45GB
hyperledger/fabric-couchdb 0.4.10 3092eca241fc 2 months ago
1.61GB
hyperledger/fabric-couchdb latest 3092eca241fc 2 months ago
1.61GB

6. Once you have followed all these steps, correctly you will get the following commands:
a. cryptogen
b. configtxgen
c. configtxlator
d. peer
e. orderer
f. Idemixgen
g. fabric-ca-client

Setup the First-Network


1. Once all the steps are done. In the terminal move to the <downloaded-fabric-
folder>/first-network
2. Run: ./byfn.sh generate

root@#####:/home/#####/fabric-samples/fabric-samples/first-network# ./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 ...
/home/######/fabric-samples/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

/home/######/fabric-samples/fabric-samples/first-network/../bin/configtxgen
##########################################################
######### Generating Orderer Genesis block ##############
##########################################################
+ configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
2018-09-11 18:48:02.279 IST [common/tools/configtxgen] main -> WARN 001 Omitting the channel ID for configtxgen is
deprecated. Explicitly passing the channel ID will be required in the future, defaulting to 'testchainid'.
2018-09-11 18:48:02.279 IST [common/tools/configtxgen] main -> INFO 002 Loading configuration
2018-09-11 18:48:02.284 IST [common/tools/configtxgen/encoder] NewChannelGroup -> WARN 003 Default policy emission is
deprecated, please include policy specificiations for the channel group in configtx.yaml
2018-09-11 18:48:02.284 IST [common/tools/configtxgen/encoder] NewOrdererGroup -> WARN 004 Default policy emission is
deprecated, please include policy specificiations for the orderer group in configtx.yaml
2018-09-11 18:48:02.285 IST [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 005 Default policy emission
is deprecated, please include policy specificiations for the orderer org group OrdererOrg in configtx.yaml
2018-09-11 18:48:02.285 IST [msp] getMspConfig -> INFO 006 Loading NodeOUs
2018-09-11 18:48:02.285 IST [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 007 Default policy emission
is deprecated, please include policy specificiations for the orderer org group Org1MSP in configtx.yaml
2018-09-11 18:48:02.285 IST [msp] getMspConfig -> INFO 008 Loading NodeOUs
2018-09-11 18:48:02.285 IST [common/tools/configtxgen/encoder] NewOrdererOrgGroup -> WARN 009 Default policy emission
is deprecated, please include policy specificiations for the orderer org group Org2MSP in configtx.yaml
2018-09-11 18:48:02.285 IST [common/tools/configtxgen] doOutputBlock -> INFO 00a Generating genesis block
2018-09-11 18:48:02.285 IST [common/tools/configtxgen] doOutputBlock -> INFO 00b Writing genesis block
+ res=0
+ set +x

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2018-09-11 18:48:02.315 IST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-09-11 18:48:02.322 IST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel
configtx
2018-09-11 18:48:02.323 IST [common/tools/configtxgen/encoder] NewApplicationGroup -> WARN 003 Default policy emission
is deprecated, please include policy specificiations for the application group in configtx.yaml
2018-09-11 18:48:02.323 IST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2018-09-11 18:48:02.323 IST [common/tools/configtxgen/encoder] NewApplicationOrgGroup -> WARN 005 Default policy
emission is deprecated, please include policy specificiations for the application org group Org1MSP in configtx.yaml
2018-09-11 18:48:02.323 IST [msp] getMspConfig -> INFO 006 Loading NodeOUs
2018-09-11 18:48:02.323 IST [common/tools/configtxgen/encoder] NewApplicationOrgGroup -> WARN 007 Default policy
emission is deprecated, please include policy specificiations for the application org group Org2MSP in configtx.yaml
2018-09-11 18:48:02.324 IST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 008 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
2018-09-11 18:48:02.357 IST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-09-11 18:48:02.361 IST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer
update
2018-09-11 18:48:02.361 IST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 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
2018-09-11 18:48:02.390 IST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2018-09-11 18:48:02.394 IST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer
update
2018-09-11 18:48:02.394 IST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update
+ res=0
+ set +x

3. Up the network: ./byfn.sh up

root@###:/home/######ya/fabric-samples/fabric-samples/first-network# ./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.2.0
DOCKER_IMAGE_VERSION=1.2.0
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 orderer.example.com ...
Creating peer1.org1.example.com ...
Creating peer1.org2.example.com ...
Creating peer0.org1.example.com ...
Creating peer0.org2.example.com ...
Creating orderer.example.com
Creating peer1.org1.example.com
Creating peer1.org2.example.com
Creating peer0.org1.example.com
Creating peer0.org2.example.com ... done
Creating cli ...
Creating cli ... done

____ _____ _ ____ _____


/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|

Build your first network (BYFN) end-to-end test

Channel 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
2018-09-11 13:23:00.347 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-09-11 13:23:00.396 UTC [cli/common] readBlock -> INFO 002 Got status: &{NOT_FOUND}
2018-09-11 13:23:00.421 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-09-11 13:23:00.631 UTC [cli/common] readBlock -> INFO 004 Received block: 0
===================== Channel 'mychannel' created =====================

Having all peers join the channel...


+ peer channel join -b mychannel.block
+ res=0
+ set +x
2018-09-11 13:23:00.751 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-09-11 13:23:01.414 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
2018-09-11 13:23:04.528 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-09-11 13:23:04.933 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
2018-09-11 13:23:08.032 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-09-11 13:23:08.484 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
2018-09-11 13:23:11.569 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-09-11 13:23:12.039 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
2018-09-11 13:23:15.105 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-09-11 13:23:15.125 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
2018-09-11 13:23:18.211 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2018-09-11 13:23:18.219 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
2018-09-11 13:23:21.291 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-09-11 13:23:21.291 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-09-11 13:23:22.781 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
2018-09-11 13:23:22.859 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-09-11 13:23:22.859 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-09-11 13:23:22.970 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
2018-09-11 13:23:23.034 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-09-11 13:23:23.034 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 +x

100
===================== 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.c
om/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.c
om/tls/ca.crt -c '{"Args":["invoke","a","b","10"]}'
+ res=0
+ set +x
2018-09-11 13:25:03.244 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
2018-09-11 13:25:03.630 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-09-11 13:25:03.630 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-09-11 13:25:08.526 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"]}'
+ res=0
+ set +x

90
===================== Query successful on peer1.org2 on channel 'mychannel' =====================

========= All GOOD, BYFN execution completed ===========

_____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/

4. The corresponding condition in docker (just an observation, no need to run): Several


containers are created and destroyed in between.
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
57892995ea9b hyperledger/fabric-peer:latest "peer node start" 14 seconds ago Created
peer0.org2.example.com
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
b95421a7fcf0 hyperledger/fabric-ccenv:latest "/bin/sh -c 'GOPATH=…" 13 seconds ago Up 10 seconds
dreamy_shaw
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
874e2cb79f88 hyperledger/fabric-tools:latest "/bin/bash" About a minute ago Up 54 seconds
cli
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
874e2cb79f88 hyperledger/fabric-tools:latest "/bin/bash" About a minute ago Up About a minute
cli
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fd6d422e05f1 e25e3df9f771 "/bin/sh -c '#(nop) …" 1 second ago Created
thirsty_bhaskara
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE
COMMAND CREATED STATUS PORTS NAMES
8508e4da5d8e dev-peer0.org2.example.com-mycc-1.0-15b571b3ce849066b7ec74497da3b27e54e0df1345daff3951b94245ce09c42b
"chaincode -peer.add…" 7 seconds ago Up 4 seconds dev-peer0.org2.example.com-
mycc-1.0
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
9c9944b678f5 hyperledger/fabric-ccenv:latest "/bin/sh -c 'GOPATH=…" 5 seconds ago Up 2 seconds
eager_euclid
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
9c9944b678f5 hyperledger/fabric-ccenv:latest "/bin/sh -c 'GOPATH=…" 16 seconds ago Up 13 seconds
eager_euclid
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE
COMMAND CREATED STATUS PORTS NAMES
631aa3330e0e dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9
"chaincode -peer.add…" 4 seconds ago Up Less than a second dev-peer0.org1.example.com-
mycc-1.0
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE
COMMAND CREATED STATUS PORTS NAMES
631aa3330e0e dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9
"chaincode -peer.add…" 11 seconds ago Up 7 seconds dev-peer0.org1.example.com-
mycc-1.0
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
fd2ff49afef0 hyperledger/fabric-ccenv:latest "/bin/sh -c 'GOPATH=…" 6 seconds ago Up 3 seconds
hungry_bhabha
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
fd2ff49afef0 hyperledger/fabric-ccenv:latest "/bin/sh -c 'GOPATH=…" 19 seconds ago Exited (0) 2 seconds
ago hungry_bhabha
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE
COMMAND CREATED STATUS PORTS NAMES
631aa3330e0e dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9
"chaincode -peer.add…" 35 seconds ago Up 32 seconds dev-peer0.org1.example.com-
mycc-1.0
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9932d183ff55 6649021f31af "/bin/sh -c '#(nop) …" 2 seconds ago Created
lucid_mestorf
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
29313676797f ea247db5bd67 "/bin/sh -c '#(nop) …" 2 seconds ago Created
ecstatic_banach
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE
COMMAND CREATED STATUS PORTS NAMES
631aa3330e0e dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9
"chaincode -peer.add…" 41 seconds ago Up 37 seconds dev-peer0.org1.example.com-
mycc-1.0
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE
COMMAND CREATED STATUS PORTS NAMES
b5b253726a2d dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab
"chaincode -peer.add…" 2 seconds ago Created dev-peer1.org2.example.com-
mycc-1.0
dev-peer1.org2.example.com-mycc-1.0
root@soumya:/home/soumya# docker ps -all
CONTAINER ID IMAGE
COMMAND CREATED STATUS PORTS NAMES
b5b253726a2d dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab
"chaincode -peer.add…" 4 minutes ago Up 4 minutes dev-peer1.org2.example.com-
mycc-1.0

5. Inspecting the last container (just an observation, no need to run):


docker inspect b5b253726a2d (b5b253726a2d is the container id)

"Config": {
"Hostname": "b5b253726a2d",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"CORE_CHAINCODE_LOGGING_LEVEL=info",
"CORE_CHAINCODE_LOGGING_SHIM=warning",
"CORE_CHAINCODE_LOGGING_FORMAT=%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} ->
%{level:.4s} %{id:03x}%{color:reset} %{message}",
"CORE_CHAINCODE_ID_NAME=mycc:1.0",
"CORE_PEER_TLS_ENABLED=true",
"CORE_TLS_CLIENT_KEY_PATH=/etc/hyperledger/fabric/client.key",
"CORE_TLS_CLIENT_CERT_PATH=/etc/hyperledger/fabric/client.crt",
"CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/peer.crt",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"CORE_CHAINCODE_BUILDLEVEL=1.2.0"
],
"Cmd": [
"chaincode",
"-peer.address=peer1.org2.example.com:7052"
],
"Image": "dev-peer1.org2.example.com-mycc-1.0-
26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"org.hyperledger.fabric.base.version": "0.4.10",
"org.hyperledger.fabric.chaincode.id.name": "mycc",
"org.hyperledger.fabric.chaincode.id.version": "1.0",
"org.hyperledger.fabric.chaincode.type": "GOLANG",
"org.hyperledger.fabric.version": "1.2.0"
}
}

6. Shutting down the network: ./byfn.sh down ---> This will kill all the
running containers.
7. Remaining experiments can be found in: https://hyperledger-
fabric.readthedocs.io/en/release-1.2/build_network.html

Você também pode gostar