hyperledger composer network update - hyperledger-fabric

Is anyone have an idea why composer network update is not listed to available commands for composer network? is it already deprecated? If yes, what is the substitute command for it? Thanks in advance.
composer network
Composer network command
Commands:
composer network download [options] Downloads a business network from the Hyperledger Fabric, does not undeploy
composer network install [options] Installs a business network archive to Hyperledger Fabric
composer network list [options] List the contents of a business network
composer network loglevel [options] Change the logging level of a business network
composer network ping [options] Test a connection to a business network
composer network reset [options] Resets a business network
composer network start [options] Starts a specific version of a business network that is already installed to Hyperledger Fabric
composer network upgrade [options] Upgrades to a specific version of a business network that is already installed to Hyperledger Fabric
Options:
--help Show help [boolean]
-v, --version Show version number [boolean]

In composer version .19 they changed the command for update.
After changing you files change the version in package.json. Then use the below command to upgrade :
composer network upgrade -c CARD-NAME -n NETWORK-NAME -V NETWORK-VERSION

Update was removed starting with composer 0.19.0 when we defined business networks as actual fabric chaincode affording it the security and management that fabric provides around chaincode.
Information about how to upgrade deployed business networks can be found here
https://hyperledger.github.io/composer/latest/business-network/upgrading-bna

Related

Installing and Starting old network (.BNA) files in hlf1.4

I created a network (.BNA) and this installs and starts successfully under hlfv12 using composer v20.9 network install and composer network start commands).
All other components (e.g. composer-rest-server and composer-playground) work fine.
I have successfully installed hlf 1.4 and can get the sample, first-network, generated, up and down.
How can I install and start my old network (.BNA) under hlf 1.4? I understand Composer v20.9 does still work under hlf1.4.
Thanks.

How can I see old data after a Hyperledger Composer Network Upgrade?

I am trying to add 1 column to my mode.cto file. Once I added and apply the following commands, I was not able to see previous data:
composer archive create -t dir -n .
composer network install -a hash-health\#0.0.3.bna -c peerAdmin#hlfv1
composer network upgrade -c peerAdmin#hlfv1 -n hash-health -V 0.0.3
But, I noticed every time there is a new docker instance running.
I want to see my old data.
This link should provide you with help around your issue https://hyperledger.github.io/composer/latest/reference/model-compatibility
Please be aware that Hyperledger Composer is now deprecated and you should focus on using the hyperledger fabric programming models. Of course you can continue to use hyperledger composer for education purposes if you wish

Changing npm proxy in hyperledger composer

I am facing some issues with my network proxy, so I am trying hit and trial sort of approach to try different proxies. I need to give the proxy configuration during composer network install command within npmConfig file, now once I have given one proxy, how can I change it, as I cannot use composer network install again for same business network.
The npmrcFile option is available on the composer network install command and once the install is done - the npmrcFile is bundled with that install package on the peers.
Because you cannot build a chaincode container due to proxy issues (ie your issues stated), start will not be successful and so thus you cannot use composer network upgrade with -o <options> to upgrade the business network with new npmrcFile changes via 'options'. This is why its best to try it out your proxy configs in a simple Dev Fabric environment - you can blow away the peer each time and install a new Fabric - once it is working (its a one-off task), then you have the correct npmrcFile to install as appropriate etc.
If need be you could use wget http://npmregistry:4873/ from a test docker container (where you do a test npm install) to see if you can connect via your network proxy - then once you know, your config file should be read when it (re-)tries the docker build.
Hope this helps.

Hyperledger composer install is not installing business network

I am using Ubuntu 16.04.2 LTS as VM, and composer v0.19.1. I have installed all the prerequisites as well as hyperledger composer and fabric by folowing the documents at hyperledger composer playgroung. I have followed the tutorial line by line to make a business network. When I want to install the business network by the following command:
composer network install --card PeerAdmin#hlfv1 --archiveFile tutorial-network#0.0.1.bna
It gives me the following error:
No connection type provided, probably because the connection profile has no 'x-type' property defined.
The screen shot of the error is provided as well.
I have checked and made sure that PeerAdminCard exists by
composer card list
And of course Fabric is started. I highly appreciate if someone mentions what I am doing wrong. Thank you.
The 2nd problem you are having is with the createPeerAdminCard.sh script - you are using an 'old' version of the where the default is Fabric v1.0.
The default is assuming hlfv1 because the environment variable FABRIC_VERSION is not set. So the createPeerAdminCard.sh script assumes you want a hlfv1 card and creates the files, but Composer v0.19 can't import that old card at the end of the script.
The fast solution is to export FABRIC_VERSION="hlfv11" then run the createPeerAdminCard.sh
I suspect that you may also have a problem with hlfv1 / v11 with the Fabric. You can check the Fabric version by running docker ps or docker images - if they have 1.0 at the end you need to remove them all and run downloadFabric.sh in the same window as you exported the FABRIC_VERSION variable, then run startFabric.sh
You need to remember to export that environment variable everytime you run one of those Fabric Tools scripts - so the better answer might be to delete the Fabric Tools folder and all docker Images and Containers - then download a new version of Fabric tools which includes the new default for Fabric 1.0
I was getting exactly the same error as you. Turns out if you update the Composer from version 0.16 or earlier, the card store still has the old PeerAdmin card which is now not compatible with version 0.19. Even deleting the card using composer card delete --card <CARD_NAME_HERE> doesn't work. The quick and dirty solution is to manually delete the card store. It is normally in ${HOME}/.composer, so to deleting this directory should work.
rm -fr ${HOME}/.composer
For your other problems, the easiest solution is to replace your older version of Hyperledger and do a new install from scratch. That means removing composer as well as killing and removing all previous Docker containers:
docker kill $(docker ps -q)
docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q)
Basically start from a clean slate if you can!
When you upgrade the composer modules from an earlier version to the latest version connection profile will not be compatible with the system. An ideal solution is to remove and delete the composer folder and create the .composer folder from the home directory and try creating PeerAdmin card again. Once that is done you are good to go for installing the starting the new business network application.

Hyperledger composer commands not working

I'm going through the Composer tutorials available here - https://hyperledger.github.io/composer/tutorials/developer-tutorial. I believe this is the official documentation.
The steps and commands listed in the developer tutorial - Deploying the business network is not working. All the steps and commands listed in this section are deprecated I think. Where can I find the latest documentation?
To give little more background, the commands failing in the developer tutorial are
composer runtime install --card PeerAdmin#hlfv1 --businessNetworkName tutorial-network
composer network start --card PeerAdmin#hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile tutorial-network#0.0.1.bna --file networkadmin.card
--card is not a parameter anymore I think, not sure though.
Composer version - v0.16.3
Operating System/version - MacOS High Sierra
Solution - skipped to tutorial deploy business network to single org https://hyperledger.github.io/composer/tutorials/deploy-to-fabric-single-org
The steps listed in this tutorial helped me create the necessary network cards with the certificate and connection profile. These were required to successfully deploy the business network in my local fabric.
Hope this helps.

Resources