hyperledger fabric - problem with crytogen tool - hyperledger-fabric

I want to create a hyperledger fabric network and create my crypto-config.yaml. but in next step according to document I run this commans :
export FABRIC_CFG_PATH=$PWD
mkdir channel-artifacts
configtxgen -profile ThreeOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
but I got this message :
2020-01-22 14:33:12.289 +0330 [common/tools/configtxgen] main -> WARN
001 Omitting the channel ID for configtxgen is deprecated. Explicitly
passing the channel ID will be required in the future, defaulting to
'testchainid'. 2020-01-22 14:33:12.289 +0330
[common/tools/configtxgen] main -> INFO 002 Loading configuration
2020-01-22 14:33:12.290 +0330 [common/tools/configtxgen/localconfig]
LoadTopLevel -> CRIT 003 Error reading configuration: Unsupported
Config Type "" 2020-01-22 14:33:12.290 +0330
[common/tools/configtxgen] func1 -> ERRO 004 Could not find
configtx.yaml. Please make sure that FABRIC_CFG_PATH or --configPath
is set to a path which contains configtx.yaml
where is my mistake? what can I do to fix it?

The configtx.yaml file is missing,as stated in the error.The path is unspecified.
You should try the command from the directory where this configtx.yaml is located.

The first warning is correct but you can avoid it.
Let's focus on
ERRO 004 Could not find configtx.yaml. Please make sure that FABRIC_CFG_PATH or --configPath is set to a path which contains configtx.yaml
The message is clear: you are missing configtx.yaml.
Do you have this file in your Fabric folder? This is mandatory to generate crypto materials.

run the below command:
export FABRIC_CFG_PATH=
After the above command, you can try the using cryptogen

Related

Error loading MSP configuration for org Org1MSP

I am facing a problem while creating the channel in HyperLedger Fabric Blockchain
ubuntu#Raghav:/mnt/c/fabric-samples/test-network$ ./network.sh createChannel
Creating channel 'mychannel'.
If network is not up, starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb
Generating channel create transaction 'mychannel.tx'
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/mychannel.tx -channelID mychannel
The logs are the following ones:
2020-10-17 12:16:23.571 IST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2020-10-17 12:16:23.651 IST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /mnt/c/fabric-samples/test-network/configtx/configtx.yaml
2020-10-17 12:16:23.651 IST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 003 Generating new channel configtx
2020-10-17 12:16:23.668 IST [common.tools.configtxgen] main -> FATA 004 Error on outputChannelCreateTx: could not generate default config template: error parsing configuration: could not create application group: failed to create application org: 1 - Error loading MSP configuration for org Org1MSP: could not load a valid ca certificate from directory /mnt/c/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/cacerts: stat /mnt/c/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/msp/cacerts: no such file or directory
+ res=1
Failed to generate channel configuration transaction...
Create channel failed

In Hyperledger Fabric v2.1, in the test-network repo sample - Error in channel creation

I'm trying to create a channel from the test-network sample of Hyperledger Fabric v2.1. I have installed all the latest fabric binaries & Docker images. The channel-artifacts, 2 peers and a ordering node were successfully created.
However, the command ./network.sh createChannel gives the following error.
Error: failed to create deliver client for orderer: failed to load config for OrdererClient: unable to load orderer.tls.rootcert.file: open /home/fabric/HLF/fabric-sample: no such file or directory
!!!!!!!!!!!!!!! Channel creation failed !!!!!!!!!!!!!!!!
I believe CreateChannel is roughly 5 steps.
Generate a CreateChannel Transaction
Generate an Anchor peer transaction
Create the channel with the genesis block
Join the peers to the channel and
Update one peer in each organization to Anchor peer.
Any chance you can share the output of ./network.sh createChannel, I'd like to see how far you got before you ran into this error.
I was able to solve this issue by removing the spaces from name of parent directory in which the "fabric-samples" repo were installed. This was the final output was:
2020-05-14 16:56:04.064 IST [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2020-05-14 16:56:04.130 IST [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' =====================
========= Channel successfully joined ===========
In my opinion, The problem is with the directory fabric-samples kindly re-download the binaries and try again.
Download using curl via:
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/release-2.1/scripts/bootstrap.sh | bash -s -- 2.1.0 1.5.2
Hope this helps, otherwise see the directory structures and path exports.

Please tell me how to solve path to chaincode does not exist

What I did:
Get into the cli container.
Make channel.
Join channel.
What I'm doing:
peer chaincode install.
I want to install the Chaincode which I have made and is on the GitHub.
So I think it can be installed like example02.
I didn't change the code in docker-compose-cli.yaml and others as well.
When I use the command "peer Chaincode install", it says "path to chaincode does not exist".
root#7fdb5cf9a746:/opt/gopath/src/github.com/hyperledger/fabric/peer#
peer chaincode install -n mycc -v 1.0 -p github.com/Gela-Gunp/OriginChaincodeForMe
2019-01-22 07:48:52.599 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2019-01-22 07:48:52.599 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2019-01-22 07:48:52.599 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2019-01-22 07:48:52.599 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
Error: Error getting chaincode code chaincode: path to chaincode does not exist: github.com/Gela-Gunp/OriginChaincodeForMe
Maybe I should do something before Chaincode install.
But I don't know what that is.
#gelatine, in your chaincode install command "-p" flag indicates your chaincode's source path (Note: local path)..
It can be like your command, but you should have those directories mounted inside your cli container. Also don't forget to take care of the GOPATH env variable :p
Please go thorough the Fabric chaincode reference docs:
Fabric Chaincode for developers

Unable to install Hyperledger Fabric Marbles chaincode from a repository to a peer

I'm using this Hyperledger Fabric tutorial, I am block on the step 1 of part Install chaincode on all peers
When I run the command peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/I have the following result containing an error :
2018-12-10 13:19:37.515 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-12-10 13:19:37.515 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: Error getting chaincode code chaincode: path to chaincode does not exist: /opt/gopath/src/github.com/fabric-samples/chaincode/marbles02_private
Could you help me please? thanks
Do you have the chaincodes in this path? Be sure you have the chaincode in this path.
Do you have Go installed? If yes, do you export the Go path?
Try with this:
export PATH=$PATH:/usr/local/go/bin

Unable to install sacc chaincode

I have a network with 2 orgs and 2 peers. I am trying to install the sample chaincode from the tutorial on one of the peers.
/opt/gopath/src/chaincode/sacc# CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:0 ./sacc
2018-10-04 00:36:40.699 UTC [shim] SetupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO
2018-10-04 00:36:40.699 UTC [shim] SetupChaincodeLogging -> INFO 002 Chaincode (build level: ) starting up ...
2018-10-04 00:36:40.699 UTC [shim] userChaincodeStreamGetter -> ERRO 003 open : no such file or directory
error trying to read file content
github.com/hyperledger/fabric/core/chaincode/shim.userChaincodeStreamGetter
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:89
github.com/hyperledger/fabric/core/chaincode/shim.Start
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/chaincode.go:150
main.main
/opt/gopath/src/chaincode/sacc/sacc.go:88
runtime.main
/opt/go/src/runtime/proc.go:198
runtime.goexit
/opt/go/src/runtime/asm_amd64.s:2361
Error starting SimpleAsset chaincode: error trying to read file content : open : no such file or directoryroot#31b1a3b7d3da:/opt/gopath/src/chaincode/sacc#
Any suggestions?
thanks
ERRO 003 open : no such file or directory error trying to read file content
your chaincode file dose not exist in the directory, please check that you have provided correct path of chaincode

Resources