官术网_书友最值得收藏!

How it works...

Here, we deployed the chaincode to the peer node. Let's now take a look at how chaincode-docker-devmode defines the blockchain configuration. chaincode-docker-devmode has some predefined configuration files and scripts.  Here are the files in chaincode-docker-devmode:

Let's take a closer look at the docker-compose-simple.yaml file:

  • This file defines services, peer, cli, and chaincode container configuration.
  • Services define the orderer service with the container name as port 7050. It points to the Docker image at hyperledger/fabric-orderer.
  • Peer defines a peer node. The peer container port is 7051. It points to a Docker image at hyperledger/fabric-peer.
  • The cli section defines the cli container name as cli. The cli container can issue a command to interact with the chaincode deployed in the peer node. It points to a Docker image at hyperledger/fabric-tools
  • The chaincode container defines the container name as chaincode. It points to a Docker image at hyperledger/fabric-ccenv

Here is the screenshot we see after we bring up the Docker containers. We can see the previously mentioned four containers running:

The script file in chaincode-docker-devmode only contains the following two commands:

peer channel create -c myc -f myc.tx -o orderer:7050
peer channel join -b myc.block

The first command creates the myc channel using the specified configuration file in the myc.tx file. The myc.tx file is generated by the configtxgen tool. This tool also generates orderer.block

The second command joins the created channel with  myc.block to the cli container. With these four containers, we can deploy our chaincode to the Fabric in the development environment.

Let's now carry out some tests from the cli container.

主站蜘蛛池模板: 明光市| 金寨县| 清丰县| 柞水县| 鄢陵县| 黔西| 防城港市| 襄樊市| 怀仁县| 巴南区| 石家庄市| 和政县| 柳林县| 沽源县| 柘荣县| 衡水市| 沭阳县| 阿尔山市| 深泽县| 六盘水市| 江西省| 宁城县| 永胜县| 尤溪县| 阿坝| 永康市| 扶风县| 闻喜县| 界首市| 古丈县| 城固县| 香港| 桐乡市| 昌吉市| 香港 | 德安县| 石泉县| 汶川县| 巩义市| 盘锦市| 黄平县|