Back

Fabric 最新 LTS 版本 2.2.2 中安装 fabcar 链码的方法

起因

2.2.2 之前 ./network.sh deployCC 会默认安装 fabcar 链码

今天新装了一个 2.2.2 版本,deployCC 默认并不安装任何链码:

$ ./network.sh deployCC
No chaincode name was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
Deploying chaincode failed

那么在 2.2.2 版本如何安装 fabcar 链码呢?

$ ./network.sh deployCC -ccn fabcar -cci initLedger -ccl go -ccp ../chaincode/fabcar/go

检查链码是否安装成功

$ peer lifecycle chaincode queryinstalled
Installed chaincodes on peer:
Package ID: fabcar_1.0:b41ab9af76a078ae8af2b9897c51f6a0c401e4c6c777414d766698b1b7fac00a, Label: fabcar_1.0
comments powered by Disqus