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

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.

主站蜘蛛池模板: 承德县| 澄江县| 池州市| 高要市| 当雄县| 金秀| 宝山区| 江阴市| 呼伦贝尔市| 新疆| 新安县| 湛江市| 七台河市| 维西| 犍为县| 建瓯市| 容城县| 八宿县| 齐齐哈尔市| 延庆县| 绵阳市| 渑池县| 文成县| 白朗县| 柘荣县| 响水县| 紫金县| 达拉特旗| 常州市| 增城市| 嘉义市| 曲阜市| 林芝县| 佛教| 瓮安县| 东港市| 南华县| 松江区| 来安县| 竹山县| 三原县|