Urgent: problems with starting local fabric(2.x) network for dev mode using docker containers #fabric #configtxgen #fabric-peer #fabric-orderer


avinash.uttav@...
 

Hi Team, 
 
I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment.
We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers and starting the peer in dev mode for debugging the chaincodes.
Below are the simple configurations for the network that we are building for.
 
1) 1 Organization
2) 1 Peer in dev mode
3) 1 Channel
 
We have been facing multiple issues in building this setup up with Fabric 2.x
We have considered below few points after reading the documents on running peer and chaincode in dev mode and using the test network
https://hyperledger-fabric.readthedocs.io/en/release-2.3/peer-chaincode-devmode.html
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html
 
1) Starting up peer in dev-mode is requires passing '--peer-chaincodedev=true'
2) TLS should not be enabled on the peer for dev-mode.
3) Orderer configuration in configtx.yml for generating genesisblock for orderer in solo mode
4) Channel configuration in configtx.yml for generating channel configuration file (ch1.tx)
 
We have tried below two approaches to build this network in docker containers and both have their own set of problems
 
Approach1:
Trimming down and editing the configurations for test-network which is provided with fabric-samples. 
 
In this approach, we are trying to edit the docker-compose-test-net.yaml file and configtx.yaml file in the test-network according to the requirements and also according the docs for running chaincode in dev mode.
Below are the edited files. 
 
We have included two new profiles into the configtx, which we use to generate genesis.block and channel.tx files. Thes profiles are namely SampleDevModeSolo, SampleSingleMSPChannel, 
These are inspired from the configtx.yaml provided under sampleconfig that is used in docs for 'running peer and chaincode in dev mode'.
This is done because of multiple reasons 
1) when we disable TLS and use the orderer in raft mode it does not work, we start getting errors that TLS is required. 
2) Also we did not find any example of orderer type etcdraft getting used in dev-setup.
3) In the default configtx.yaml the consortium configuration was also not present, which was giving us some errors as well.
 
Therefore we pulled in these two profiles from sampleconfig to test-network, and edited them accordingly.
 
Steps that we are following to build the network and createChannel.
1. ./network.sh up with the compose file to bring up the containers.
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. Running below command from the peer container to create the channel.
export CORE_PEER_LOCALMSPID=Org1MSP
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@.../msp (Locations are mounted on peer container)
peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
 
In Step4 we are hitting below issue.
"Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied"
 
We have tried changing the configurations in many ways but we are still stuck on this issue.
Could you please take a look at our cofigtx.yaml file attached and docker-test-net file.
Are we missing any configurations in these ?
 
 
Approach2:
 
We followed the docs for 'running peer and chaincode in dev mode' and started to build docker-compose to bring up the containers for peer and orderer.
We have also edited the configtx.yaml regarding listen addresses so that containers can talk to each other.
Below are the steps that we followed.
1. docker compose up to bring the network up 
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. peer channel create -o orderer.example.com:7050 -c ch1 -f /etc/hyperledger/configtx/ch1.tx
 
5. peer channel join -b ch1.block
 
6. Started the chaindode, and it was able to register with the peer. we got success log for chaincode registration.
 
7. peer lifecycle chaincode approveformyorg  -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --package-id GoCheck1:1.0
8. peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" 
9. peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID ch1 --name chGo1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --peerAddresses peer0.org1.example.com:7051
 
10. But, after above steps when we invoke the chaincode using command "peer chaincode invoke -o orderer.example.com:7050 -C ch1 -n GoCheck1 -c '{"Args":["Init"]}' --isInit". 
 
We hit below issue.
"Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction ab60ed335f58830a247fad5dda4bc7c7faf0f84c15dce416d655170240c2fae4: could not 
launch chaincode GoCheck1:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'GoCheck1:1.0': open /var/hyperledger/production/chaincodes/GoCheck1.1.0: no such file or directory"
 
Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
The same steps when we are running peer and orderer and chaincode in seperate processes they work fine, but not in container.
 
This is an urgent issue for us. Could you please check our configs for this approach and suggest us if we are missing something in the configs or is there any better way to approach this problem.
 
 
Thanks
Avinash Uttav


Chris Gabriel <alaskadd@...>
 

Hi Avinash,
A possible workaround is to use the IBM Blockchain extension for VSCode and view the output dialog.  Or you could just use that as it is well documented and you avoid reinventing the wheel.
best,
Chris 


On Dec 10, 2021, at 10:09 AM, avinash.uttav@... wrote:


Hi Team, 
 
I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment.
We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers and starting the peer in dev mode for debugging the chaincodes.
Below are the simple configurations for the network that we are building for.
 
1) 1 Organization
2) 1 Peer in dev mode
3) 1 Channel
 
We have been facing multiple issues in building this setup up with Fabric 2.x
We have considered below few points after reading the documents on running peer and chaincode in dev mode and using the test network
https://hyperledger-fabric.readthedocs.io/en/release-2.3/peer-chaincode-devmode.html
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html
 
1) Starting up peer in dev-mode is requires passing '--peer-chaincodedev=true'
2) TLS should not be enabled on the peer for dev-mode.
3) Orderer configuration in configtx.yml for generating genesisblock for orderer in solo mode
4) Channel configuration in configtx.yml for generating channel configuration file (ch1.tx)
 
We have tried below two approaches to build this network in docker containers and both have their own set of problems
 
Approach1:
Trimming down and editing the configurations for test-network which is provided with fabric-samples. 
 
In this approach, we are trying to edit the docker-compose-test-net.yaml file and configtx.yaml file in the test-network according to the requirements and also according the docs for running chaincode in dev mode.
Below are the edited files. 
 
We have included two new profiles into the configtx, which we use to generate genesis.block and channel.tx files. Thes profiles are namely SampleDevModeSolo, SampleSingleMSPChannel, 
These are inspired from the configtx.yaml provided under sampleconfig that is used in docs for 'running peer and chaincode in dev mode'.
This is done because of multiple reasons 
1) when we disable TLS and use the orderer in raft mode it does not work, we start getting errors that TLS is required. 
2) Also we did not find any example of orderer type etcdraft getting used in dev-setup.
3) In the default configtx.yaml the consortium configuration was also not present, which was giving us some errors as well.
 
Therefore we pulled in these two profiles from sampleconfig to test-network, and edited them accordingly.
 
Steps that we are following to build the network and createChannel.
1. ./network.sh up with the compose file to bring up the containers.
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. Running below command from the peer container to create the channel.
export CORE_PEER_LOCALMSPID=Org1MSP
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@.../msp (Locations are mounted on peer container)
peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
 
In Step4 we are hitting below issue.
"Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied"
 
We have tried changing the configurations in many ways but we are still stuck on this issue.
Could you please take a look at our cofigtx.yaml file attached and docker-test-net file.
Are we missing any configurations in these ?
 
 
Approach2:
 
We followed the docs for 'running peer and chaincode in dev mode' and started to build docker-compose to bring up the containers for peer and orderer.
We have also edited the configtx.yaml regarding listen addresses so that containers can talk to each other.
Below are the steps that we followed.
1. docker compose up to bring the network up 
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. peer channel create -o orderer.example.com:7050 -c ch1 -f /etc/hyperledger/configtx/ch1.tx
 
5. peer channel join -b ch1.block
 
6. Started the chaindode, and it was able to register with the peer. we got success log for chaincode registration.
 
7. peer lifecycle chaincode approveformyorg  -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --package-id GoCheck1:1.0
8. peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" 
9. peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID ch1 --name chGo1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --peerAddresses peer0.org1.example.com:7051
 
10. But, after above steps when we invoke the chaincode using command "peer chaincode invoke -o orderer.example.com:7050 -C ch1 -n GoCheck1 -c '{"Args":["Init"]}' --isInit". 
 
We hit below issue.
"Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction ab60ed335f58830a247fad5dda4bc7c7faf0f84c15dce416d655170240c2fae4: could not 
launch chaincode GoCheck1:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'GoCheck1:1.0': open /var/hyperledger/production/chaincodes/GoCheck1.1.0: no such file or directory"
 
Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
The same steps when we are running peer and orderer and chaincode in seperate processes they work fine, but not in container.
 
This is an urgent issue for us. Could you please check our configs for this approach and suggest us if we are missing something in the configs or is there any better way to approach this problem.
 
 
Thanks
Avinash Uttav
<Approach1.zip>
<Approach2.zip>


David Faulstich Diniz Reis
 

To check the logs I use the logspout. An easy way is to execute the script monitordock.sh inside the commercial paper tutorial. I use it to show the docker logs when I show something about Hyperledger (when teaching someone about hlf). 

You will be able to see output from the docker network. Take care if you put the environment with log status set to debug.

Em sex., 10 de dez. de 2021 às 16:02, Chris Gabriel <alaskadd@...> escreveu:

Hi Avinash,
A possible workaround is to use the IBM Blockchain extension for VSCode and view the output dialog.  Or you could just use that as it is well documented and you avoid reinventing the wheel.
best,
Chris 


On Dec 10, 2021, at 10:09 AM, avinash.uttav@... wrote:


Hi Team, 
 
I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment.
We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers and starting the peer in dev mode for debugging the chaincodes.
Below are the simple configurations for the network that we are building for.
 
1) 1 Organization
2) 1 Peer in dev mode
3) 1 Channel
 
We have been facing multiple issues in building this setup up with Fabric 2.x
We have considered below few points after reading the documents on running peer and chaincode in dev mode and using the test network
 
1) Starting up peer in dev-mode is requires passing '--peer-chaincodedev=true'
2) TLS should not be enabled on the peer for dev-mode.
3) Orderer configuration in configtx.yml for generating genesisblock for orderer in solo mode
4) Channel configuration in configtx.yml for generating channel configuration file (ch1.tx)
 
We have tried below two approaches to build this network in docker containers and both have their own set of problems
 
Approach1:
Trimming down and editing the configurations for test-network which is provided with fabric-samples. 
 
In this approach, we are trying to edit the docker-compose-test-net.yaml file and configtx.yaml file in the test-network according to the requirements and also according the docs for running chaincode in dev mode.
Below are the edited files. 
 
We have included two new profiles into the configtx, which we use to generate genesis.block and channel.tx files. Thes profiles are namely SampleDevModeSolo, SampleSingleMSPChannel, 
These are inspired from the configtx.yaml provided under sampleconfig that is used in docs for 'running peer and chaincode in dev mode'.
This is done because of multiple reasons 
1) when we disable TLS and use the orderer in raft mode it does not work, we start getting errors that TLS is required. 
2) Also we did not find any example of orderer type etcdraft getting used in dev-setup.
3) In the default configtx.yaml the consortium configuration was also not present, which was giving us some errors as well.
 
Therefore we pulled in these two profiles from sampleconfig to test-network, and edited them accordingly.
 
Steps that we are following to build the network and createChannel.
1. ./network.sh up with the compose file to bring up the containers.
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. Running below command from the peer container to create the channel.
export CORE_PEER_LOCALMSPID=Org1MSP
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@.../msp (Locations are mounted on peer container)
peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
 
In Step4 we are hitting below issue.
"Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied"
 
We have tried changing the configurations in many ways but we are still stuck on this issue.
Could you please take a look at our cofigtx.yaml file attached and docker-test-net file.
Are we missing any configurations in these ?
 
 
Approach2:
 
We followed the docs for 'running peer and chaincode in dev mode' and started to build docker-compose to bring up the containers for peer and orderer.
We have also edited the configtx.yaml regarding listen addresses so that containers can talk to each other.
Below are the steps that we followed.
1. docker compose up to bring the network up 
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. peer channel create -o orderer.example.com:7050 -c ch1 -f /etc/hyperledger/configtx/ch1.tx
 
5. peer channel join -b ch1.block
 
6. Started the chaindode, and it was able to register with the peer. we got success log for chaincode registration.
 
7. peer lifecycle chaincode approveformyorg  -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --package-id GoCheck1:1.0
8. peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" 
9. peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID ch1 --name chGo1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --peerAddresses peer0.org1.example.com:7051
 
10. But, after above steps when we invoke the chaincode using command "peer chaincode invoke -o orderer.example.com:7050 -C ch1 -n GoCheck1 -c '{"Args":["Init"]}' --isInit". 
 
We hit below issue.
"Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction ab60ed335f58830a247fad5dda4bc7c7faf0f84c15dce416d655170240c2fae4: could not 
launch chaincode GoCheck1:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'GoCheck1:1.0': open /var/hyperledger/production/chaincodes/GoCheck1.1.0: no such file or directory"
 
Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
The same steps when we are running peer and orderer and chaincode in seperate processes they work fine, but not in container.
 
This is an urgent issue for us. Could you please check our configs for this approach and suggest us if we are missing something in the configs or is there any better way to approach this problem.
 
 
Thanks
Avinash Uttav
<Approach1.zip>
<Approach2.zip>



--
David Reis
@davidfaulstich (Instagram)
@davidfdr (Github)



David Enyeart
 

You will get the Approach1 error if the signer of the create channel transaction ("peer channel create" caller) isn't an admin of a consortium member.
If you start the orderer with FABRIC_LOGGING_SPEC=debug, you should be able to see if the signer has the admin role or not, right before the error message in the orderer log.
Note that v2.4 added an additional warning message for these types of errors, it includes the failed policy and signer credential information to help troubleshoot these scenarios. You should be able to simply swap in the v2.4 orderer container to get the additional message in the orderer log.

The Approach2 error is not expected, you shouldn't have to install chaincode on the peer. Since it works for you when running as a process, something must not be correct in the containerized configuration.


Dave Enyeart
IBM Blockchain


avinash.uttav---12/10/2021 11:09:40 AM---Hi Team, I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue belo

From: avinash.uttav@...
To: fabric@...
Date: 12/10/2021 11:09 AM
Subject: [EXTERNAL] [Hyperledger Fabric] Urgent: problems with starting local fabric(2.x) network for dev mode using docker containers #fabric #configtxgen #fabric-peer #fabric-orderer
Sent by: fabric@...





Hi Team, I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment. We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi Team,
 
I am a Software Engineer in Blockchain Platform team at Oracle. We are facing an issue below with running fabric in local environment.
We are trying to build a setup for starting a fabric-network locally with fabric-2.3/2.4 containers and starting the peer in dev mode for debugging the chaincodes.
Below are the simple configurations for the network that we are building for.
 
1) 1 Organization
2) 1 Peer in dev mode
3) 1 Channel
 
We have been facing multiple issues in building this setup up with Fabric 2.x
We have considered below few points after reading the documents on running peer and chaincode in dev mode and using the test network
https://hyperledger-fabric.readthedocs.io/en/release-2.3/peer-chaincode-devmode.html
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html
 
1) Starting up peer in dev-mode is requires passing '--peer-chaincodedev=true'
2) TLS should not be enabled on the peer for dev-mode.
3) Orderer configuration in configtx.yml for generating genesisblock for orderer in solo mode
4) Channel configuration in configtx.yml for generating channel configuration file (ch1.tx)
 
We have tried below two approaches to build this network in docker containers and both have their own set of problems
 
Approach1:
Trimming down and editing the configurations for test-network which is provided with fabric-samples.
 
In this approach, we are trying to edit the docker-compose-test-net.yaml file and configtx.yaml file in the test-network according to the requirements and also according the docs for running chaincode in dev mode.
Below are the edited files.
 
We have included two new profiles into the configtx, which we use to generate genesis.block and channel.tx files. Thes profiles are namely SampleDevModeSolo, SampleSingleMSPChannel,
These are inspired from the configtx.yaml provided under sampleconfig that is used in docs for 'running peer and chaincode in dev mode'.
This is done because of multiple reasons
1) when we disable TLS and use the orderer in raft mode it does not work, we start getting errors that TLS is required.
2) Also we did not find any example of orderer type etcdraft getting used in dev-setup.
3) In the default configtx.yaml the consortium configuration was also not present, which was giving us some errors as well.
 
Therefore we pulled in these two profiles from sampleconfig to test-network, and edited them accordingly.
 
Steps that we are following to build the network and createChannel.
1. ./network.sh up with the compose file to bring up the containers.
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. Running below command from the peer container to create the channel.
export CORE_PEER_LOCALMSPID=Org1MSP
export CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/users/Admin@.../msp (Locations are mounted on peer container)
peer channel create -o orderer.example.com:7050 -c mychannel -f /etc/hyperledger/configtx/channel.tx
 
In Step4 we are hitting below issue.
"Error: got unexpected status: BAD_REQUEST -- error validating channel creation transaction for new channel 'mychannel', could not successfully apply update to template configuration: error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Admins' sub-policies to be satisfied"
 
We have tried changing the configurations in many ways but we are still stuck on this issue.
Could you please take a look at our cofigtx.yaml file attached and docker-test-net file.
Are we missing any configurations in these ?
 
 
Approach2:
 
We followed the docs for 'running peer and chaincode in dev mode' and started to build docker-compose to bring up the containers for peer and orderer.
We have also edited the configtx.yaml regarding listen addresses so that containers can talk to each other.
Below are the steps that we followed.
1. docker compose up to bring the network up
2. Using configtxgen to create genesis block
configtxgen -profile SampleDevModeSolo -channelID syschannel -configPath $FABRIC_CFG_PATH -outputBlock $(pwd)/configtx/genesis.block
3. Using configtxgen to create channel.tx
configtxgen -channelID mychannel -outputCreateChannelTx ./configtx/channel.tx -profile SampleSingleMSPChannel -configPath $FABRIC_CFG_PATH
4. peer channel create -o orderer.example.com:7050 -c ch1 -f /etc/hyperledger/configtx/ch1.tx
 
5. peer channel join -b ch1.block
 
6. Started the chaindode, and it was able to register with the peer. we got success log for chaincode registration.
 
7. peer lifecycle chaincode approveformyorg  -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --package-id GoCheck1:1.0
8. peer lifecycle chaincode checkcommitreadiness -o orderer.example.com:7050 --channelID ch1 --name GoCheck1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')"
9. peer lifecycle chaincode commit -o orderer.example.com:7050 --channelID ch1 --name chGo1 --version 1.0 --sequence 1 --init-required --signature-policy "OR ('SampleOrg.member')" --peerAddresses peer0.org1.example.com:7051
 
10. But, after above steps when we invoke the chaincode using command "peer chaincode invoke -o orderer.example.com:7050 -C ch1 -n GoCheck1 -c '{"Args":["Init"]}' --isInit".
 
We hit below issue.
"Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction ab60ed335f58830a247fad5dda4bc7c7faf0f84c15dce416d655170240c2fae4: could not
launch chaincode GoCheck1:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'GoCheck1:1.0': open /var/hyperledger/production/chaincodes/GoCheck1.1.0: no such file or directory"
 
Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
The same steps when we are running peer and orderer and chaincode in seperate processes they work fine, but not in container.
 
This is an urgent issue for us. Could you please check our configs for this approach and suggest us if we are missing something in the configs or is there any better way to approach this problem.
 
 
Thanks
Avinash Uttav





Matthew White
 

Hello;

On Approach #2..

Do we still need to install the chaincode in the peer, if we are running the peer in dev mode inside a docker container ?
No, the approach you are doing is basically correct; using a different packaging of Fabric, but with the same concepts 
https://hyperledgendary.github.io/docs/tutorials/hyperfast_contract_development.html I was successful in the same approach

Have you tried using the `fabric-samples` test-network?  I'd be concerned if there's something wrong in the initial setup that is causing later issues. The error suggests to me that the peer still thinks this chaincode is going to be used in non-dev mode. 

 

Matthew White
IBM Blockchain Development