0

The HLF Version I use is 2.2

I set up my own network consisting of 3 Orgs, 1 Orderer and 2 Channels. The network is set up and I can call Chaincode Functions responding with 200. So far, so good. The problem is I don't see the worldstate in CouchDB. I think it's related due to the fact the chaincode is not instantiated properly or at all

When I call:

peer chaincode list --instantiated -C examplechannel

It doesn't return anything. But if I try to set the flag --isInit on the first Invoke.

peer chaincode invoke -o localhost:7050 -C examplechannel -n example --peerAddresses localhost:9051 --isInit -c '{"function":"instantiate","Args":[]}'

The response is:

chaincode 'example' does not require initialization but called as init

When I try to instantiate the Chaincode by:

peer chaincode instantiate -o localhost:7050 -C examplechannel -n example -v 1 -c '{"function":"instantiate","Args":[]}' 

I get the response:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg Channel 'examplechannel' has been migrated to the new lifecycle, LSCC is now read-only

Any suggestions?

Pantaurus
  • 1
  • 2

1 Answers1

0

There is difference in the chaincode installation from Fabric version 2.0 when compare to previous version. Please refer below documentation for more details regarding new chaincode lifecycle

https://hyperledger-fabric.readthedocs.io/en/release-2.2/deploy_chaincode.html

GPC
  • 381
  • 2
  • 14
  • I have added the flag `--init-required` where necessary. Now the invoke call works with the flag `--isInit`. And CouchDB create a Database with the name channelname_contractname. But there is atleast one problem. When I call a second invoke without `isInit` like it should be, i get the response `Error: endorsement failure during invoke. response: status:500 message:" invalid invocation: chaincode 'example' has not been initialized for this version, must call as init first"`. And the database channelname_contractname wont show any entries. Despite the init functions gets called. – Pantaurus Feb 04 '22 at 09:16