composer network deploy, command not found - hyperledger-composer

I am doing this tutorial: https://www.ibm.com/developerworks/cloud/library/cl-deploy-interact-extend-local-blockchain-network-with-hyperledger-composer/index.html
And here I have to do composer network deploy but this is what I get:
composer network <subcommand>
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]
Incorrect command. Please see the list of commands above, or enter "composer network --help".
So my Question here is if this command got changed to composer network install?

Yes the command has been changed to composer network install. You can follow documentation of composer for the commands.

Related

Drupal 8 run composer as root

My host provider allows me to use only root user (the only one with /bin/bash) on my virtual machine that I'm using to host a drupal 8 site installed with composer.
From composer website I see they strongly advise to avoid running composer as super-user/root, they say to use composer install --no-plugins
I tried the command apt-get composer install --no-plugins but outputs the error
E: Command line option --no-plugins is not understood in combination
with the other option
I'm still running composer as root, even thought there is always an alert, how can avoid that?
If Composer is already installed, there is no need to call apt-get, which is the standard package installer on Debian systems. composer install --no-plugins does the job

Incorrect command error for composer network deploy

I'm following this tutorial on macOS.
$ composer -v
v0.20.1
$ composer network deploy -a dist/iot-perishable-network.bna -A admin -S adminpw -c PeerAdmin#hlfv1 -f networkadmin.card
Incorrect command. Please see the list of commands above, or enter "composer network --help".
Available composer network commands in the list mentioned above: download, install, list, loglevel, ping, reset, start, upgrade
You are using Composer v0.20.1, the tutorial you are referring to is using Composer v0.15.0.
The deploy command has been removed since Hyperledger 0.19.0.
See https://github.com/hyperledger/composer/releases/tag/v0.19.0 :
The following commands are no longer valid:
composer runtime install
composer network deploy
composer network update
composer network undeploy
You now have to use the following commands instead :
composer network install
composer network start
composer network upgrade
See https://hyperledger.github.io/composer/latest/reference/commands for last valid commands.

Hyperledger composer Redeploy Banana file

I have installed latest Hyperledger Composer 0.19. Now with new version the command "composer network update" is not available. Now I am not sure how to redeploy changes in .BNA file to the network. Can someone explain how "Composer network install" command can be used to redeploy incremental changes to .BNA file to the network
This was changed as part of the native fabric deployment support added to Composer in 0.19.0. From the 0.19.0 release notes:
This release includes a fundamental change in the way that business
networks are deployed. Business networks are now deployed within
Hyperledger Fabric 'as chaincode' meaning that the business network
(rather than Composer runtime) can be agreed by all parties and
signed, using a similar management model to non-Composer chaincode. As
a result of this, the deployment and update process has changed.
You need to use the new composer network upgrade command instead:
The commands to upgrade (update) a business network have changed and
are now:
composer network install
composer network upgrade
The following commands are no longer valid:
composer runtime install
composer network deploy
composer network update
composer network undeploy
You are correct that the commands have changed for v0.19 of composer.
For each release there is a releases document which covers the changes - so checking these when you upgrade is good.
When you first deploy your network you use the commands:
composer network install and
composer network start
and there are examples in the https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial.
When you subsequently want to deploy a new version you use the commands:
composer network start and
composer network upgrade
There are examples of these in the Queries tutorial.
These new commands for Composer bring it more into line with the underlying Fabric now that it can use Native NodeJS chaincode.

How can I run composer with ddev?

I need to run composer on my ddev project and don't have it on my Windows machine. For example, the project requires a composer install before startup. How can I use composer in this environment, especially on Windows?
Updated 2018-11-15 to show native ddev support (ddev composer command)
There are several ways to run composer for your project.
ddev v1.4.0 now has the ddev composer and ddev composer create commands. These run composer inside the container, so you're guaranteed to get composer behavior that matches the in-container hosting environment. (This matters most for Windows users.)
ddev composer require swiftmailer/swiftmailer
ddev composer update
ddev composer install
ddev composer create drupal-composer/drupal-project:8.x-dev --stability dev
Note that ddev composer create is not exactly the same as composer create-project so you don't have to understand complexities of the underlying filesystem. There are drupal and TYPO3 ddev composer create examples in the docs.
Nothing here prevents you from using any composer technique that you're comfortable with, but this is a great way to get predictable on-linux in-container composer builds. It should be hugely important for people using Windows OS, where composer is less available and has some unpredictable behavior.
Install on the host the old fashioned way: If composer is installed on your computer/host, just composer install. However, that only works on macOS and Linux, and only works if you have the right versions of php related components. It does not work well at all on Windows (NTFS) because the symlinks composer creates are not compatible with usage inside the (Linux) web container. (Composer is not hard to install on Windows: Use chocolatey and choco install -y composer. You'll want to enable the gd and curl extensions in c:\tools\php72\php.ini)
All the normal composer behavior has always been installed inside your web container, so you can use that whether or not you have composer on your host computer. For example: ddev exec composer install -d /var/www/html will do a composer install in the root of your repository, exactly the same as ddev composer install. You can also do ddev ssh and operate on the command line in the container.
Try this hooks approach to running composer install inside the container (on the mounted partition) every time your project starts:
hooks:
post-start:
- exec: composer install -d /var/www/html
For some older ideas on composer patterns (mostly obsoleted by ddev composer, See
How to: Use "composer create-project" and DDEV to start a new Drupal 8 site when Composer isn't installed on the host machine and
How to: Set up a D8/Composer site on Pantheon without CircleCI, custom upstreams
To expand on the accepted answer, DDEV now has a composer-specific hook.
hooks:
post-start:
- composer: install -d /var/www/html
The reason for using this instead of exec, I assume, is that there are also pre-composer and post-composer hooks, so maybe this also executes those hooks. I'm not sure of that or the actual difference, though.

Could not deploy business network to hyperledger fabric beta using composer

I have tried to deploy a business network using composer to but it fails with the following error
Error: event message must be properly signed by an identity from the same organization as the peer: [Expected MSP ID Org1MSP, received ]]
what is the problem ?
There are several reasons why you might get this error
You are not running composer v0.8.0 or higher. You can check what level you are running by invoking the command
composer -v
You haven't specified a valid hlfv1 profile or you forgot to specify the profile to use on the network deploy command. If you have followed the tutorials and guides on the hyperledger composer site then a profile will have been created called hlfv1. Ensure you specify it on the command line invocations. For example to deploy
composer network deploy -a test.bna -i PeerAdmin -s anything -p hlfv1
You are running an older version of docker. Level may be checked by invoking the command: docker -v
Invoking the ./prereqs-ubuntu.sh detailed in the 'Installing a developing with Hyperledger Composer' will update the prerequisites accordingly.

Resources