Hyperledger first network sample error - hyperledger-fabric

I am following this link first-network to run hyperledger samples name first-network.
I am using Ubuntu 18.04LTS
./byfn.sh -m generate got successfully executed.
When I am trying to execute ./byfn.sh -m up I am getting error
`2018-05-08 08:45:22.485 UTC [main] main -> ERRO 001 Cannot run peer because cannot init crypto, missing /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp folder
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========
Edits 1: Adding docker compose files
docker-compose-cli.yaml
docker-compose-couch.yaml
docker-compose-e2e.yaml
docker-compose-couch-org3.yaml
docker-compose-e2e-template.yaml
docker-compose-org3.yaml

Your crypto materials are not getting generated properly as required . Check that you have all the Prerequisites installed on the platform(s) I hope you have downloaded all the platform specific binaries https://github.com/hyperledger/fabric/blob/master/scripts/bootstrap.sh
This will make sure you have the correct Cryptogen and Configtxgen tools for creating crypto material,ca clients and channel configurations .

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

Hyperledger cannot update channel

I am trying to update an existing channel to enable lifecyle.
Official link:
https://hyperledger-fabric.readthedocs.io/en/release-2.2/enable_cc_lifecycle.html
Launching this command on my peer:
peer channel update -f config_update_in_envelope.pb -c channelid -o orderer.domain.com:7050 --cafile /opt/gopath/s
rc/github.com/hyperledger/fabric/crypto-config/peerOrganizations/*******/ca
Error
got unexpected status: BAD_REQUEST -- initializing channelconfig failed: could
not create channel Consortiums sub-group config: setting up the MSP
managerfailed: expected at least one CA certificate
I tried all existing ca certs available on my network and It's not working,
Please help
Thanks
This error was "probably" due to a version mismatch ... one orderer used on my network was still using an 1.4 version, since this orderer has been upgraded it's not possible to reproduce this error again. Even if I do not understand why the error msg is talking about a CA file ...

Error when deploying chaincode in test network

I've just started working on fabric an am having some trouble using the command:
./network.sh deployCC
after setting up my channels. This is the terminal readout:
'''
deploying chaincode on channel 'mychannel'
Vendoring Go dependencies ...
~/desktop/HF/fabric-samples/chaincode/fabcar/go ~/desktop/HF/fabric-samples/test-network
scripts/deployCC.sh: line 24: go: command not found
~/desktop/HF/fabric-samples/test-network
Finished vendoring Go dependencies
Using organization 1
++ peer lifecycle chaincode package fabcar.tar.gz --path ../chaincode/fabcar/go/ --lang golang --label fabcar_1
++ res=1
++ set +x
Error: failed to normalize chaincode path: failed to determine module root: exec: "go": executable file not found in $PATH
!!!!!!!!!!!!!!! Chaincode packaging on peer0.org1 has failed !!!!!!!!!!!!!!!!
ERROR !!! Deploying chaincode failed
'''
It seems that I must have messed something up in the prereqs. Any suggestions?
You are missing 'go' prerequisite. See in the test network documentation, the prerequisites section. You will need to install golang.
The Golang chaincodes can only be packaged through the CLI container. All the other language chain codes can be packaged through peer containers as well.

Error when trying to create and join a channel in hyperledger fabric blockchain services

I am trying to setup my own network using HyperledgerFabric. I have completed all the required steps and started the nodes. It worked fine and got the below response.
Then tried to create and join a channel using the commands stated below and i got this error.
2019-02-28 13:43:07.440 UTC [main] InitCmd -> ERRO 001 Cannot run peer because cannot init crypto, folder "/app/HYPERLEDGER/fabric-samples/BaseNetwork/crypto-config/peerOrganizations/citizen.example.com/users/Admin#citizen.example.com/msp" does not exist
Try installing docker version 18.03.1. If that doesn't helps try docker volume prune, clear the containers, images and re-pull.

Hyperledger Fabric 1.0 e2e failure

I am facing couple of issues when running e2e_cli examples.
I was able to complete all the steps(mentioned in documentation) before running this example
LOGS
sudo ./network_setup.sh up sahil
Channel name - sahil
Building configtxgen
Makefile:72: *** "No go in PATH: Check dependencies". Stop.
Generating genesis block
2017/04/19 13:00:16 Loading configuration
2017/04/19 13:00:16 Could not find configtx.yaml in paths of [ ].Try setting ORDERER_CFG_PATH, PEER_CFG_PATH, or GOPATH correctly.
mv: cannot stat 'orderer.block': No such file or directory
Generating channel configuration transaction
2017/04/19 13:00:16 Loading configuration
2017/04/19 13:00:16 Could not find configtx.yaml in paths of [ ].Try setting ORDERER_CFG_PATH, PEER_CFG_PATH, or GOPATH correctly.
mv: cannot stat 'channel.tx': No such file or directory
Starting orderer0
peer0 is up-to-date
peer1 is up-to-date
peer2 is up-to-date
peer3 is up-to-date
Recreating cli
Channel name : sahil
2017-04-19 13:00:18.269 UTC [logging] InitFromViper -> DEBU 001 Setting default logging level to DEBUG for command 'channel'
2017-04-19 13:00:18.269 UTC [msp] GetLocalMSP -> DEBU 002 Returning existing local MSP
2017-04-19 13:00:18.269 UTC [msp] GetDefaultSigningIdentity -> DEBU 003 Obtaining default signing identity
Error connecting: rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure
Error: rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure
Usage:
peer channel create [flags]
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================
go is in path
sahil.kapoor#a1dvmcphdlt01:~/work/src/github.com/hyperledger/fabric/examples/e2e_cli $ go version
go version go1.8 linux/amd64
Could not find configtx.yaml in paths of [ ].. This file also present.
GOPATH=/home/sahil.kapoor/work
GOROOT=/usr/local/go
And my farbic folder is inside GOPATH
/work/src/github.com/hyperledger/fabric/examples/e2e_cli
Apparently, there's some issue in latest e2e example which has not been fixed yet. Look at https://jira.hyperledger.org/browse/FAB-3042. You should be able to run it when this gets fixed.
if you want to set up a new network you will need the config files orderer.block and channel.tx
This script will create them for you.
cd $GOPATH/src/github.com/hyperledger/fabric/examples/e2e_cli
chmod +x generateCfgTrx.sh
./generateCfgTrx.sh <channel-ID>
in your case:
./generateCfgTrx.sh sahil
Please note that you have been cloning from the master branch of the git repo.
Followed these steps to get e2e_cli working( the $GOPATH/src/github.com/hyperledger/fabric project folder):
Once you've cloned as per the instruction, perform
git checkout fa3d88cde177750804c7175ae000e0923199735c
Download the docker images by executing the shell script
sh examples/e2e_cli/download-dockerimages.sh
Remake the configtxgen file in the home folder of the project:
make configtxgen
Now you can setup your network:
sh examples/e2e_cli/network_setup.sh
Try this out and let us know if this solution fits right in!
RESULT (run docker ps):
Result Screenshot
If you still have problems, please let us know along with the logs!!!
I experienced the same problem. The solution that worked for me is to run this command before ./byfn.sh -m generate the command is
docker rm $(docker ps -a -q)
This command really clears the docker containers. If you still have this issue let me know.

Resources