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

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.

主站蜘蛛池模板: 丹棱县| 绥阳县| 漳浦县| 浦东新区| 昭觉县| 石狮市| 乌鲁木齐市| 宣汉县| 江华| 嘉义县| 汨罗市| 社旗县| 连平县| 青冈县| 绥棱县| 松溪县| 古丈县| 汽车| 齐齐哈尔市| 桐梓县| 晋江市| 治县。| 丁青县| 宝鸡市| 东乡族自治县| 莒南县| 新津县| 日喀则市| 满城县| 富锦市| 盐城市| 车致| 新和县| 新巴尔虎右旗| 磐安县| 保山市| 邯郸市| 高淳县| 伽师县| 镇康县| 句容市|