Closed DazWilkin closed 6 years ago
Not having the peer joined to the channel wouldn't cause the card to fail to import.
I don't think it would cause that error, but can you try with -u admin
in the card create?
Also, what version of composer are you using?
I'm also not seeing what version of Fabric you're using. If it's v1.1.0, you're connection profile's got to be a bit more substantial: https://hyperledger.github.io/composer/latest/reference/connectionprofile
Thanks!
I'm using the Helm Chart from this repo and it uses:
toolsImage: ibmblockchain/fabric-tools:1.0.0
ordererImage: ibmblockchain/fabric-orderer:1.0.0
caImage: ibmblockchain/fabric-ca:1.0.0
peerImage: ibmblockchain/fabric-peer:1.0.0
and it includes:
composer --version
v0.16.2
The Deployment is created from this file which is simpler than the one you reference. I'll try create something more complete: https://github.com/IBM-Blockchain/ibm-container-service/blob/master/cs-offerings/kube-configs/composer-card-import.yaml
IIUC, I tried using -u admin
:
$ composer card create -u admin -p connection.json
Successfully created business network card file to
Output file: admin@hlfv1.card
Command succeeded
$ composer card import -f admin@hlfv1.card
Error: Failed to save card: admin@hlfv1
Command failed
$ ls -l
total 20
drwxr-xr-x 2 root root 4096 Dec 14 18:32 LICENSE
-rw-r--r-- 1 composer composer 2022 Jun 6 22:54 PeerAdmin.card
-rw-r--r-- 1 composer composer 612 Jun 6 23:08 admin@hlfv1.card
drwxr-xr-x 2 composer composer 4096 Jun 6 22:42 composer-logs
-rw-r--r-- 1 composer composer 385 Jun 6 22:42 connection.json
Hmm, you wouldn't want to try the more complicated profile for a fabric 1.0.0 network, but you could get a newer version of composer (stay on the 0.16.x level). Last I checked, it was 0.16.6.
Solved!
I mixed up volume mounts between:
Helm Chart's blockchain-utils
yaml's mountPath: /home/composer/
and
composer-card-import
script's mountPath: /home/composer/.composer
In full disclosure, I've not used Composer previously and was hoping that, by following through these scripts, it would work without issue. It doesn't.
I'm having issues getting the Peers to join the Channel (https://github.com/IBM-Blockchain/ibm-container-service/issues/97) so it's entirely possible that this subsequent step won't work until that issue is addressed. However, it doesn't appear immediately dependent.
The
composer-card-import
Pod|container fails withError: Failed to save card: PeerAdmin@hlfv1
So getting on to the container and running the script step-by-step: