Upgrade of Hyperledger fabric from 1.4.2 to 2.0 - hyperledger-fabric

I am trying to upgrade our current network setup in fabric 1.4.2 to 2.0. We have a kubernetes setup. I see in the documentation that first we need to upgrade the peer database by using peer node upgrade-dbs and then start the peer. But since this command doesnot exist with peer version 1.4.2 I cannot do it from the running peer pod. when I tried to change the peer image to 2.0 version I get error following error. Error in instantiating ledger provider: unexpected format. db info = [leveldb for channel-IDs at [/var/hyperledger/production/ledgersData/ledgerProvider]], data format = [], expected format = [2.0]
How can I upgrade the peer database and start the peer pod in kubernetes ?

I resolved the issue my manually deleting the couchDB database and then starting the peer with 2.0 image

Related

Error While Installing Fabric Chaincode: _lifecycle.syscc: no such file or directory

While trying to install chaincode using Fabric v2.1, I am encountering an error. Does anyone face similar issues? My peer is running fine and able to join the channel as well. I am able to list the channel details as well.
Note: I am doing Native installation without using docker images for running orderer and peer.
Highly appreciate for your support and looking forward to hear from you.
Error:
chaincode install failed with status: 500 - error in simulation: failed to execute transaction 44688cc50afeda03e3f5e7735ae650030952477b6bdfce83064582f42bec6c84: could not launch chaincode _lifecycle.syscc: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package '_lifecycle.syscc': open /home/vagrant/ledger/ORG2/peer1-org2/ledger/chaincodes/_lifecycle.syscc: no such file or directory
I got this error after upgrading from 1.4. In my case the problem was in the old config file for the peer.
Make sure you have next lines in your core.yaml:
chaincode:
...
# enabled system chaincodes
system:
_lifecycle: enable

The mismatch of chaincode verison within fabric peers

In this situation:
1,Peer X is down
2,Other peer perform upgrade of chaincode with success
3,Peer X is up, it will receive block and tx from the order/other peers, but it lacks of the newest version of chaincode.
4,In my try, if update the chaincode on peer X, it will result to mismatch of the version within peers
How to make all peer have the same verison of chaincode?
You must install the last version of the chaincode in all the endorser peers. Always. The admin of each organization should do that, to be accurate.
Install it in every endorser peer and instantiate/upgrade once.
Be sure that you have the same version in every peer by comparing:
md5sum /var/hyperledger/production/chaincodes/mychaincode.1.0

hyperledger explorer not starting with Fabcar app

Hyperledger Explorer is not starting with Fabcar sample application. I have configured config.json and change connection profile to fabcar. I am using default connection setting available in connection-profile/fabcar.jason.But while starting blockchain explorer it giving me below error.
2019-11-30T09:44:53.671Z - error: [Channel.js]: Error: 2 UNKNOWN: Stream removed
Error : Failed to connect client peer, please check the configuration and peer status
Did you start a network before? If so, try to remove the crypto-config and channel-artifacts folders and rerun. When you start a network should not be crypto material from other before

adding new peer | 'chaincode with name 'cc' already exists' on composer network start

I am facing issues while while starting chaincode on my newly added peer in hyperledger network. Let me explain you the issue I am facing.
I had up and running hyperledger network where I had installed my bna with version 0.0.1. When I ping my network everything works fine. I have added new peer in network without bringing network down. Now I am trying to install bna on newly added peer. I have added new peer in connection profile for both organizations after adding I have created card and installed on organization where I have added new peer. bna is installed on the peer successfully. Now I am trying to start the network with composer network start. this is the point where I am receiving the following error.
Processing these Network Admins:
userName: user1
userName: user2
× Starting business network definition. This may take a minute...
Error: Error trying to start business network. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: chaincode with name 'cc' already exists
Response from attempted peer comms was an error: Error: chaincode with name 'cc' already exists
Response from attempted peer comms was an error: Error: chaincode with name 'cc' already exists
Response from attempted peer comms was an error: Error: chaincode with name 'cc' already exists
Response from attempted peer comms was an error: Error: chaincode with name 'cc' already exists
Command failed
Please help in this matter. How am I suppose to add bna on newly added peer in network. I dont want bring my network down while adding new peer and install bna file.
So long as the bna is the same on the other peers, then you don't need to do anything else. All you need to do is install it onto the peer (the install command will not install it on peers that already have the bna, but will install it on peers that don't have it), and it sounds like you have done the correct approach by updating your connection profile and run the install command using an identity that is in the same MSP as your new Peer.
You do not need to start the business network because it is already started and that is the meaning of the error you are getting.
Now if you submit a transaction it will be sent to all peers in your connection profile. For your new Peer it will bring up the chaincode (ie the business network) automatically so that it can simulate that submission.

SSL3_GET_RECORD:wrong version number in Hyperledger Blockchain Explorer

I am trying to run Hyperledger Blockchain Explorer with a Hyperledger Fabric network setup using the steps here. composer-cli works good. But when I run Blockchain Explorer with node main.js it returns following error
16637 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number.
composer-cli is able to connect well with peers which means the SSL connection between composer-cli and peers is good. How do I fix the version of SSL running on blockchain explorer written in node.js ?

Resources