hyperledger / hyperledger/fabric

Chaincode installation has failed: chaincode type not supported

Open
#4,714 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
16.7k
Forks
9.1k
Avg merge
5h 38m
Merged PRs (30d)
26

Description

Hi, I'm following the tutorial on Linux and struggling with installing asset-transfer-basic chaincode.
It works fine on M1 mac but I wasn't able to install chaincode on Linux which is offline.
When I execute `$ peer lifecycle chaincode install basic.tar.gz`,
the message "chaincode type not supported: golang command=detect" appears.

Server info
```
OS : CentOS Linux 7
Architecture : x86_64
Go : go 1.21.4 linux/amd64
```

Here's what I have done:
### 1. Downloaded and modified install-fabric script.
(https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh)

Modified install-fabric.sh :
- Line 24: _arg_fabric_version: "2.5.4" → "2.5.5"
- Line 31: PLATFORM=linux-amd64
### 2. Downloaded samples and binary on M1 mac.
`$ ./install-fabric.sh s b`
### 3. Downloaded 2.5.5/1.5.7/3.3.2 docker image on M1 mac and move them to the server.
(1.5.7 for fabric-ca, 3.3.2 for couchdb)
`$ docker pull --platform linux/amd64 hyperledger/${IMAGE}:${VERSION}`
`$ docker save -o hyperledger.${IMAGE)}.tar.gz -hyperledger/${IMAGE}:${VERSION}`
### 4. Brought the hyperledger network up on Linux
`$ /network.sh up createChannel -c mychannel -ca -s couchdb`

result

```
Creating channel 'mychannel'.
If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'couchdb with crypto from 'Certificate Authorities Bringing up network
LOCAL_VERSION =v2.5.5
DOCKER IMAGE VERSION =v2.5.5
CA LOCAL VERSION =v1.5.7
CA_DOCKER_IMAGE_VERSION =v1.5.7
Generating certificates using Fabric CA
NFO [channelCd] InitCmdFactory -> Endorser and orderer connections initialized
INFO [channelmd] update -> Successfully submitted channel update
Anchor peer set for org 'Org2MSP' on channel 'mychannel'
Channel 'mychannel' joined
```

### 5. packge & install chaicode
`$./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go`

result
```
Using docker and docker-compose /var/run/docker.sock
deploying chaincode on channel 'mychannel' executing with the following
- CHANNEL_NAME: mychannel
- CC_NAME: basic
- CC_SRC_PATH: /asset-transfer-basic/chaincode-go/
- CC_SRC_LANGUAGE: go
- CCIVERSION: 1.01
- CC_SEQUENCE: auto
- COLEND POLICY: NA
- CC_COLL_CONFIG: NA
- COLINIT_FON: NA
- DELAY: 3
- MAX RETRY: 5
- VERBOSE: false executing with the following
- CC_NAME: basic
- CC_SRC_ PATH:../asset-transfer-basic/chaincode-go/
- CC_SRC_LANGUAGE: go
- CC_VERSION: 1.0.1
Vendoring Go dependencies at /asset-transfer-basic/chaincode-go/ ~/fabric/asset-transfer-basic/chaincode-go ~/fabric/test-network ~/fabric/test-network
Finished vendoring Go dependencies
+ '[' false = true ']'
+ peer lifecycle chaincode package basic.tar.gz --path../asset-transfer-basic/chaincode-go/--lang golang --label basic_1.0.1
+ res=0
Chaincode is packaged
Installing chaincode on peer0.org1...
Using organization 1
+ peer lifecycle chaincode queryinstalled --output json + jq-r 'try (installed_chaincodesi.package_id)*
+ grep '^ basic_1.0.1:cdd2db2045c093a6c584ac4c1f0c14abf5bed3e3/567be9796c0eeb32771cdIf$*
+ test 1 -ne 0
+ peer lifecycle chaincode install basic.tar.gz
-----
After few seconds
-----
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode: could not build chaincode: docker build failed: docke Chaincode installation on peer0.org has failed
Deploying chaincode failed
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.