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

  • Hyperledger Cookbook
  • Xun (Brian) Wu Chuanfeng Zhang Andrew Zhang
  • 198字
  • 2021-06-24 14:59:39

Getting ready

Let's first get the fabric library in our environment. Navigate to the assetmgr directory, run the get chaincode library command, and then start build:

cd $GOPATH/src/assetmgr
go get -u github.com/hyperledger/fabric/core/chaincode/shim
go build

This will load the chaincode library and compile the Go code. Next, we will deploy the chaincode using the dev mode. Normally, we need to define our own channel, peer, and configuration Docker container to run our chaincode. Hyperledger, however, provides a sample dev network with a pre-generated orderer and channel artifact. This allows the user to start using chaincode for quick development and testing. You should have already set up the Fabric runtime environment with the fabric-samples project. If you haven't already done so, check out the previous chapter, or refer to fabric-samples in the GitHub link and follow the instructions: https://github.com/hyperledger/fabric-samples.

At the time of writing this book, 1.4 is the latest version of fabric-samples.

In our example project, we use the build in the fabric-samples project and set this same project as the default user home directory, as follows:

Let's now open three Terminals and navigate to the chaincode-docker-devmode directory of fabric-samples:

$ cd chaincode-docker-devmode
主站蜘蛛池模板: 全南县| 太保市| 边坝县| 卫辉市| 密山市| 香河县| 永善县| 镶黄旗| 吐鲁番市| 丽江市| 沙湾县| 鹿邑县| 于田县| 寿阳县| 桂平市| 赫章县| 焦作市| 岳普湖县| 合作市| 报价| 隆林| 吉安市| 介休市| 华坪县| 扬中市| 朝阳县| 澄迈县| 新巴尔虎左旗| 仙游县| 西畴县| 额尔古纳市| 个旧市| 三江| 东宁县| 五莲县| 新晃| 梅河口市| 保靖县| 建水县| 东城区| 海淀区|