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

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.

Related

sudo ./byfn.sh generate command is throwing an error saying crypto-gen tool not found

I have been trying to install hyperledger fabric on raspberry PI and i have installed all the prerequisites for running up the sample byfn using fabcar samples but there's an error saying that "Docker composer is not able to pull the images" when i am trying to generate using the command ./byfn.sh generateDocker-compose is causing an
There are no pre-built docker images for ARM on docker hub, neither are there any pre-built binaries for the ARM architecture either.
To run BYFN I needed a 4Gb system, I just cannot see a raspberry pi ever being able to run BYFN.
I believe other people have successfully compiled (from source) and run a single peer on a raspberry pi in the past, but as more capability is added to the Peer, it's system requirements will increase and it also requires storage to hold the complete blockchain.

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 network update

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

Error trying to enroll user and return certificates

I am trying to deploy Hyperledger Composer Business Network to IBM Blockchain Platform BaaS on IBM Cloud. I used the following steps:
Create connection.json
Create composer card for admin identity
Import the card to composer
Request certificates for an identity
When I am trying step 4, I am getting an error stating:
"Error: failed to request identity. Error trying to enroll user and return certificates. Error: Calling enrollment endpoint failed with error [Error: connect ECONNREFUSED 169.60.181.250:31011]
Command failed"
I have updated the versions. And I guess the issue is due to network rules which is set in my environment. So I would request IP Range which IBM BaaS Starter and Enterprise kit consumed for Peers, Certification Authority.
Please let me know if anyone have information on IP Series.
I am guessing this is on the Starter Plan?
If so, 1) ensure that you have the latest Node version (8.10.0), and npm (5.6.0). You can check your node version with
node -v and npm with npm -v
If npm or node are earlier versions, update them.
Starter Plan is currently compatible with Composer-cli v0.18.1
2) check your composer-cli version with
composer -v
If it is not v0.18.1, then uninstall composer:
npm uninstall -g composer-cli
and install v0.18.1:
npm install -g composer-cli#0.18.1
Now, once you create your blockchain service on IBM Cloud, when you launch your service, and ensure you are in the overview tab. Click on connection profile -> download, and rename it to connection-profile.json and place it in the folder where you have your .bna file. Then, open up the connection-profile.json file you just downloaded and go all the way to the bottom where you see registrar. Under that, you will see enrollId and 'enrollSecret'. Your first command then should be using that enrollSecret from the connection-profile. Ensure you are in the same directory as your recently downloaded connection-profile.json. The first command should be:
composer card create -f ca.card -p connection-profile.json -u admin -s <enrollSecret>
after that issue this command:
composer card import -f ca.card -n ca
and lastly:
composer identity request --card ca --path ./credentials
This should solve your problem. Also, I have written a full blog of me deploying a custom .bna to Starter Plan if you have any other concerns.

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.

Resources