Start hyperledger composer with previously imported admin card - hyperledger-composer

I have problems with imported admin card for BNA.
First session, everything is ok, then I deploy BNA on local HLF:
- ./startFabric.sh
- ./createPeerAdminCard.sh
- composer network install -a test-bna#0.0.1 -c PeerAdmin#hlfv1
- composer network start -c PeerAdmin#hlfv1 -n test-bna -V 0.0.1 -A admin -S adminpw # create an admin card for test-bna BNA.
- composer card import -f ./admin#test-bna.card # card successfully imported
- composer network ping -c admin#test-bna ---> ok!
Second session: I can not reuse an already imported card to start the test-bna BNA,
composer network start creates a new card file and results in an error. I can see admin#test-bna card in "composer card list" but I can not use it!

Playground stores data in the browsers cache and deleting this solved this issue for me. If that does not work, here are a couple of other possible solutions to try out:
Hyperledger Composer : No business network has been specified for this connection

Related

How do I resolve the following issue on hyperledger composer cli command for identity issue?

image 1 image 2
From the following link
https://hyperledger.github.io/composer/reference/composer.identity.issue.html
composer identity issue -c admin#mron-business-network -fsupplier -u suppid -a "resource:org.mron.Supplier#S001" -x false
Issue identity and create Network Card for: suppid
✖ Issuing identity. This may take a few seconds...
Error: fabric-ca request register failed with errors [[{"code":400,"message":"Authorization failure"}]]
Command failed
same message posted on Rocketchat earlier. It would appear that the admin id in your card is not the one currently known to the CA server. After import using (for example) composer card import -f <filename>, you need to connect to the business network (or use composer network ping -c admin#mron-business-network to connect) - for the credentials (key/certificate) to be downloaded to the wallet from the CA server. You can then verify this with a composer card list --name admin#mron-business-network and see the 'Credentials set' message for the card in question.

Composer 0.14 - Error: The current identity has not been registered: admin

After the update to 0.14, I am no more able to connect to the chain from the cli
composer network ping -p hlfv1 -n basic-sample-network -i admin -s adminpw
or
composer-rest-server -p hlfv1 -n basic-sample-network -i admin -s adminpw -N never
I have the following error
Error: Error trying to ping. Error: Error trying to query business network.
Error: chaincode error (status: 500, message: Error: The current identity has not been registered: admin)
All composer component were updated to 0.14, and the test was made with basic-sample-network. For information, npm test on this exemple was perfectly.
OS: Ubuntu
Please confirm that you have read the 0.14.0 release notes, particularly the "How to deal with this change" section:
https://github.com/hyperledger/composer/releases/tag/v0.14.0
You need to update your ACLs and redeploy your network, binding a network admin participant.
There are two ways for specifying the business network administrators
on the command line: Note: This option is the one most users will
want! When running composer network deploy and composer network start,
in addition to the normal parameters you would use, you should also
include -A admin -S to bind the admin identity as a network admin
participant. If you don't do this, the identity you use to deploy the
business network, usually PeerAdmin, will be bound into the business
network as a business network administrator, and this is probably not
what you want.

How to add multiple peers in fabric composer?

Basic sample networks provided by composer are working on only one peer. How ca we add multiple peers in the network and enroll user to each peer.
You will need to define your Hyperledger Composer v1. connection profile to include those peers, where-ever they are located.
You need to install Composer runtime onto those 2 peers - using composer runtime install command. Then start the network. See https://hyperledger.github.io/composer/reference/composer.runtime.install.html
Eg.
composer runtime install -n my-network -p hlfv1 -i PeerAdmin -s adminpw
then
composer network start -a mybiznetwork.bna -p hlfv1 -i PeerAdmin -s adminpw
It will have deployed its own chaincode container for the business network.
Obviously, before these commands are executed, you would have to ensure the PeerAdmin's crypto material (ie PeerAdmin in the examples above) has been imported so as to be recognised by the CA server. Eg. so that you can then install the composer runtime onto a peer using the composer runtime install command etc etc.
See http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html. Once you have created your own topology you need to configure your connection profiles and identities appropriately using Composer. A connection profile represents a single organisation interacting on a single channel. Of course in fabric you are allowed to submit transactions to other peers in different organisations so that connection profile can contain peers from other organisations but only for transaction submission. If you want to simulate handling of 2 or more organisations then you will need profiles for each organisation.

Trying to deploy a business network onto hyperledger fabric 1.0 beta fails to install chaincode

I have v0.8.0 of hyperledger composer installed and when I try to deploy the business network using the following command I get an install chaincode error
composer network deploy -a test.bna -p hlfv1 -i admin -s adminpw
And the response is
Error: error trying to deploy. Error: error trying install chaincode. Error
What is the problem ?
The security model changed after hyperledger v1.0.0-alpha1. Now peers have the concept of Admin users. The userid 'admin' is a userid controlled and owned by the certificate authority server that is provided as part of the fabric composer development hyperledger fabric and has no authority on the Peer.
The Development fabric pre-loads the peer's Admin id into the KeyValStore defined by the profile 'hlfv1' and calls it PeerAdmin. This is the userid you must specify in order to deploy a business network onto the peer.
As this user has already preloaded it doesn't have a secret but hyperledger composer currently requires a secret to be specified. It doesn't matter what you specify for the secret so long as you specify something. So the deploy command looks like
composer network deploy -a test.bna -p hlfv1 -i PeerAdmin -s anything

"composer network ping" won't show the participant after "composer identity issue"

I am following steps in https://fabric-composer.github.io/managing/identity-issue.html to check the identity issuing for participants. I get no errors and when executing:
composer identity issue -n 'mychain-network' -i WebAppAdmin -s DJY27pEnl16d -u user1 -a "com.example.model.Owner#userid"
I get correctly:
The participant can now connect to the business network with the following details:
userID = user1
userSecret = kJoWHaYCxnes
The problem is that later I don't get the participant when pinging:
$ composer network ping -n 'mychain-network' -i user1 -s kJoWHaYCxnes
The connection to the network was successfully tested:
version = 0.5.5
participant = <no participant found>
Command completed successfully.
Am I missing something? Thanks.
In order for this to work with fabric v0.6, you need to start up the membership service with the following environment variable
MEMBERSRVC_CA_ACA_ENABLED=true
easiest way to do this is to update your docker compose file, for example
membersrvc:
image: hyperledger/fabric-membersrvc
ports:
- '7054:7054'
environment:
- MEMBERSRVC_CA_ACA_ENABLED=true
command: membersrvc
your example should then have the participant field with the correct value.

Resources