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.
Related
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.
I have a new server, where multiple clients will host their webapps at. From Wordpress, to laravel, to simple html shizzle.
As you may know, Laravel requires Composer to be installed. This can be done locally, but also globaly. I am wondering (if there are any) about the pros and cons.
Of course, you can run the global installation from anywhere. But can this be a issue for other development projects on the server, or are there security for the global installation?
The disadvantage of using a globally installed composer is this
you're likely using different versions along the development pipeline
you may end up with different results
Just as an example, in a project, we had composer.phar checked in and updated regularly, but we ran into problems when the version we used was already updated to be able to use the ^ operator, however, a different binary was used during deployment, unaware of that operator, and the deployment failed.
The safest bet is to use the same version of composer.phar along the development pipeline. Alternatively, as mentioned before, keeping the globally installed composer regularly updated.
Since we usually use Makefiles in our projects, here's an example of what it looks like:
.PHONY: composer cs it test
it: cs test
composer:
composer self-update
composer validate
composer install
cs: composer
vendor/bin/php-cs-fixer fix --diff --verbose
test:
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml
vendor/bin/phpunit --configuration=test/Integration/phpunit.xml
I would always suggest install globally, it will be easier for you to manage, and you could easily keep it up to date.
In the other projects they will not need to clutter their project with
composer.phar file
I have Composer installed on my computer to manage the dependencies, but I am on a shared hosting account without SSH access to install Composer. How would I go about uploading this project to the server without Composer?
The project is a PHP project with Amazon and other libraries and APIs.
Don't worry, you don't need composer on your production server, in this case.
What you can do, if not done already, is run composer update on ANOTHER (maybe local) dev machine and test your application.
If everything is OK, upload all files (yes, vendor and all) to your host.
I've got a client on a shared hosting environment (which I can't change) and I'm needing to install the Parse PHP SDK, but the host won't allow me to install the Composer package manager. Does anyone else know of a manual install method?
If you have wget/unzip available, just download latest release zip (bellow the release, this file).
Use unzip to unpack package and load it with PSR-4 autoloading (the composer's approach).
Composer isn't meant to be an installer, so you are not expected to run Composer on the production machine. What would happen if during your update process Github would be down? No new website version! And maybe also no old version.
Run Composer somewhere else, and then upload the result to the server, after you verified that everything went well.
There's always been a note in many Readmes of composer-based projects:
Never run composer update on production server
However, there are times that we want to run composer update on PROD servers to keep current (of course after a thorough test on local server). What's the best way to do that?
You should run on local server.
composer update
Next you should test application and add composer.lock to repository. And on PROD server you should run
composer install
composer update is checking if there are any new versions of the packages available within the limits of the versions given. This will unconditionally install new packages if they are eligible. After that you have to test.
composer install will install whatever is mentioned in the lock file, and if the currently installed packages are not the ones mentioned there, they will get uninstalled or updated.
Of course you want to "update" the prod application. But to update the packages, you run composer install which will update the packages to the TESTED state in the lock file - not to an UNTESTED state because newer versions did appear after you tested.