Unsupported Config Type "" - hyperledger-fabric

While generating the configtx peer block for Hyperledger Fabric Channel Creation in Amazon Managed Blockchain
Facing an error
CRIT 002 Error reading configuration: Unsupported Config Type ""
ERRO 003 Could not find configtx.yaml. Please make sure that FABRIC_CFG_PATH or --configPath is set to a path which contains configtx.yaml
Even though I tried export FABRIC_CFG_PATH=$PWD still facing same error.

Make sure you defined correctly the Fabric config directory. In terminal in the root folder of you HLF configuration just use the command:
export FABRIC_CFG_PATH=${PWD}/<folder-with-configtx.yaml-and-crypto-config.yaml>

Related

How to make core.yaml effect in a container in Hyperledger Fabric

A peer has been installed in a container.
I wanted to instantiate a chaincode in the container, but it failed because the version of a docker image doesn't exist.
so, I want to change "fabric-ccenv:latest" to "fabric-ccenv:2.1".
I have tried to modify the core.yaml, but it has no effect.
I also tried to directly export the varible, it also has no effect.
my question is how to make the configure effective. maybe my solution is false, but i reffer this link:Instantiation of Chaincode using Fabric Node SDK gives API error (404): manifest for hyperledger/fabric-ccenv:latest not found
I really appreciate your warm-hearted help.
In docker-compose.yaml
in "volumes" section of your peer: create bind to location of your edited core.yaml
e.g.: - ./channel/config-peers/org1-peer0/:/etc/hyperledger/peer
in the "environment" section of your peer: add FABRIC_CFG_PATH= path to location of edited core.yaml
e.g.: FABRIC_CFG_PATH=/etc/hyperledger/peer

debug node js chaincode ...?

This link gives tutorial on debugging javascript chaincode in hyperledger fabric. I was able to debug my chaincode following it but recently I updated to fabric 1.2 and the peer channel list command
CORE_PEER_LOCALMSPID=Org1MSP CORE_PEER_MSPCONFIGPATH=/home/bct/fabric-samples/basic-network/crypto-config/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp peer channel list
fails with:
Fatal error when initializing core config : error when reading core
config file: Unsupported Config Type ""
I tried to go back to v1.1 but the problem persists. Can someone give me the complete list of configuration steps that may have been missed in tutorial video (which I was following) that make the debugging chaincode work.
Thanks in advance.
Finally, figured out that fabric sdk (https://github.com/hyperledger/fabric-sdk-node) has to be downloaded and configured before following the video tutorial in the question.

Hyperledger Fabric can't find go files when building chaincode

Problem
I'm getting the following error on a fabric-peer: Failed to generate platform-specific docker build: Error returned from build: 1 "can't load package: package chaincodes/simple: no buildable Go source files in /chaincode/input/src/chaincodes/simple.
Context
I'm trying to instantiate a chaincode package after having successfully installed it.
Both the install and instantiate proposals are created by the Fabric NodeJS SDK (fabric-client).
Steps leading up to the problem
Package a go file using the fabric-client (succeeds)
Create an install proposal and send it to the peer (succeeds
Create and instantiate proposal and send it to the peer (fails with above error-message)
Steps taken to solve the problem
I tried to assert how the chaincode container create process works by reading the code.
What I got from it was the following:
- The chaincode is build using the fabric-ccenv image
- It loads a .tar as an Inputstream (The package?)
I tried adding the files to the go-path but I still couldn't get it to work.
What I want to know
- Where does the chaincode building process expect these files to be?
- Why do I need to provide the files when I've previously sent a package of chaincode inside an InstallRequest?
Further information
I'm also getting an error about an MSP being unknown. Something along the lines of: Error: MSP Org1MSP is unkown. This happens during deserialization of the proposal.
Which is weird because I'm 100% that MSP exists. What I'm not certain about is whether I need to add anchor peers to the channel I'm installing and instantiating the chaincode on in order for the MSP to be found.
I thought that happens during channel creation.
Versions
This happens in the following versions:
- 1.0.0
- 1.0.6
Please do not suggest I try version 1.1 because I cannot upgrade easily.
Please advise.
Above was caused by an actual unknown MSP.
Double check the profile/profiles in configtx.yaml used for creating the channel and the genesis block for orderers. I had a mismatch between those.
I read a related issue [FAB-7952] in Fabric's issue manager and it made me think something else was going on, instead of an actual unknown MSP.

Create and join channel error ; Hypereldger fabric tutorial

I'm trying to a tutorial of hyperledger fabric on Mac. (http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html#create-join-channel)
At 'Create & Join Channel' part, I have 2 questions.
1.I typed export CHANNEL_NAME=mychannel, but there is apparently no change. What does this command mean?
2.And later, I typedpeer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem , the following error occurred. What if I do, the problem will be resolved?(There seems to be no such directory, so do I have to create? )
[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
Accordingly, I use Mac and installed all of the guided resources yesterday or day before yesterday, so I think resource version is correct.
I'd appreciate if you could answer these questions.
Question 1: export CHANNEL_NAME=mychannel Sets the CHANNEL_NAME variable to "mychannel".
Following that tutorial you linked, this just sets the variable ($CHANNEL_NAME) they have in their command:
peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME
However, you are right when you say changing that does nothing because you have hardcoded "mychannel" in your peer channel create command. Both your way and the tutorial way will have the same end result.
Question 2: The directory below points to where the peer certificates for the MSP are supposed to be, in your example. These files are generated with the ../bin/cryptogen generate --config=./crypto-config.yaml command from the tutorial. The error message is saying that the peer is unable to start due to that directory not existing, or containing the needed certs. I would ensure the peer container has those certs in that location, one way would be to Docker exec into it.
/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp

Hyperledger Fabric peer error

I'm running Hyperledger on an ubuntu virtual machine. After installing hyperledger prerequisites and binaries, when I try to execute the 'peer' command, it returns:
[main] main -> ERRO 001 Fatal error when initializing core config :
error when reading core config file: Unsupported Config Type "".
On my machine (MAC) the command runs perfectly and displays the command usage description.
Any ideas? I tried with 3 virtual machines and all result to to the same error.
Please refer to this link.
Possible solutions :
Set Path FABRIC_CFG_PATH=$PWD
Error in following configuration
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin#org1.example.com/msp CORE_PEER_ADDRESS=peer0.org1.example.com:7051 CORE_PEER_LOCALMSPID="Org1MSP" CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
There is typo mistake in your code.
Make sure FABRIC_CFG_PATH environment variable is set to a directory. In the Hyperledger Fabric docker containers, it is usually set to /etc/hyperledger/fabric.

Resources