Fabric sample调试遇到错误 Error: error getting chaincode code fabcar: Unknown chaincodeType: UNDEFIN

几个月前下载过fabric-sample,最近想起来调试一下,按照官网“创建第一个应用”步骤做的时候遇到个错,如下:

> startFabric.sh javascript
...
ctions initialized

2019-09-17 07:12:28.371 UTC [cli/common] readBlock -> INFO 002 Received block: 0

# Join peer0.org1.example.com to the channel.

docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/[email protected]/msp" peer0.org1.example.com peer channel join -b mychannel.block

2019-09-17 07:12:28.577 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

2019-09-17 07:12:28.685 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel

Creating cli ... done

2019-09-17 07:12:30.384 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc

2019-09-17 07:12:30.384 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

Error: error getting chaincode code fabcar: Unknown chaincodeType: UNDEFINED

网上查到的信息不多,有类似的错但一般最后不是报UNDEFINED,而是node什么之类。我想会不会是启动的指令参数“javascript”程序根本就不认识:
./startFabric.sh javascript

于是随便换个参数试试

./startFabric.sh heheda

果然报同样的错,怀疑是代码比较老了有些不一致的地方,上github查最新的fabcar目录结构如下

fabric-samples
 - fabcar
   -java
   -javascript-low-level
   -javascript
   -typescript

而我本地目录结构是这样

>ls fabric-samples/fabcar
enrollAdmin.js	package.json	registerUser.js
invoke.js	query.js	startFabric.sh

确实不一样。

不纠结了,直接删掉代码重新clone重做。

你可能感兴趣的:(区块链)