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.
Related
I'm trying to install and deploy my own system chaincode in hyperledger fabric. I'm using v1.3. I came across this answer Hyperledger Fabric System Chaincode Plugin - missing sample. But it's specific to v1.1 and now importsyscss.go looks very different.
I tried to follow the procedure mentioned in the above link but it didn't work out for me.
I copied myscc.so file in /opt/lib/. Made an entry myscc: enable in core.yaml as well.
Uncommented
example configuration:
- enabled: true
name: myscc
path: /opt/lib/myscc.so
invokableExternal: true
invokableCC2CC: true
docker restart peer0.org1.example.com
docker logs peer0.org1.example.com
Everything runs perfectly without any error but still, I don't see logs with myscc mentioned anywehere.
SCC plugins were disabled, but they added a secret flag to allow this for faster development.
The peer has to be built with the following flags:
GO_TAGS+=" pluginsenabled" make peer
End-to-End tests utilize docker containers hence the containers should also be built with
DOCKER_DYNAMIC_LINK=true GO_TAGS+=" pluginsenabled" make peer-docker
I am trying to deploy chaincode in devmod on my ubuntu machine. I am following this tutorial.
The issue is when I use this command : CORE_CHAINCODE_LOGLEVEL=debug CORE_PEER_ADDRESS=localhost:7052 npm start
it shows the following error:
2018-09-20T16:27:18.292Z ERROR [lib/handler.js] uncaughtException: The "peer.address" program argument must be set to a legitimate value of <host>:<port>
Full logs can be found here:
https://hastebin.com/arerozesad.sql
I am following this tutorial:
https://hyperledger-fabric.readthedocs.io/en/v1.0.6/peer-chaincode-devmode.html
First, I hope you are using Fabric v1.1 or later as Node.js chaincode is not supported in v1.0.x.
The instructions you listed are for running Go chaincode.
For Node.js chaincode, your command should look like
CORE_CHAINCODE_ID_NAME="mycc:v0" node mycc.js --peer.address grpc://localhost:7052
You should be able to replace node mycc.js with npm start as well.
See https://github.com/hyperledger/fabric-chaincode-node#test-nodejs-chaincode for more information.
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.
Code
Currently I followed this article to develop my BNA to IBM blockchain cloud platform (started plan). Unluckily, I got the error when I try to run this line of code:
composer network start -c admin#mynetwork-fabric -A admin -C ./creds/admin-pub.pem -f delete.card -n my_network -V 0.0.4
Error
I am very sure that all parameters are good, the full errors are:
Error: Error trying to start business network. Error: No valid responses
from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN:
premature execution - chaincode (my_network:0.0.4) launched and
waiting for registration
Or sometimes the error is:
Error: Error trying to start business network. Error: No valid responses
from any peers.
Response from attempted peer comms was an error: Error:
REQUEST_TIMEOUT
I understand sometimes maybe there is a timeout, but I do not really got the launched and waiting for registration error.
P.S.
My hyperledger composer version is 0.19.
I also view this deploying tutorial, there might be some different commands, because of the different versions of Hyperledger Composer. I checked the composer hep to transfer the commands to running on composer 0.19.
Solution:
down grade composer-cli to 0.18.1
change your package.json, composer-cli to 0.18.1
npm install to create new bna
reinstall
restart
If you are using IBM Cloud Starter Plan, then you need to be using v0.18.1 of Composer not v0.19.
Also, this is the doc you should be following:
https://console.bluemix.net/docs/services/blockchain/develop_starter.html#deploying-a-business-networks-on-starter-plan
I am trying to configure hyperledger composer with multi peer. But when I have started the hyperledger fabric, getting following response.
amandai#ubuntultop:~/block chain/fabric-samples V1/ess-multipeer-sample /network$ ./byfn.sh -m up
Starting with channel 'essplchannel' and CLI timeout of '10000' seconand CLI delay of '3' seconds
Continue (y/n)? y
proceeding ...
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
Creating network "network_amsnetwork" with the default driver
Creating orderer.esspl.com ...
Creating peer0.ezone.esspl.com ...
Creating peer0.essbbsr.esspl.com ...
Creating ca_peerEssbbsr ...
Creating ca_peerezone ...
Creating peer0.ezone.esspl.com
Creating orderer.esspl.com
Creating ca_peerezone
Creating peer0.ezone.esspl.com ... done
Creating ca_peerEssbbsr ... done
Error response from daemon: No such container: cli
amandai#ubuntultop:~/block chain/fabric-samples V1/ess-multipeer-sample/network$
I have used COMPOSE_FILE=docker-compose.yaml instead of COMPOSE_FILE=docker-compose-cli.yaml due to this error came. After modifying it working as expected.
Is it possible your error may be captured by the answers posted here -> Error when try to instantiate chain-code on Hyperledger Fabric - perhaps making sure there's no 'space' in your directory name (as shown above) may help / setting the variable explicitly?
I had a similar error recently and it related to having some conflicting containers already active. In a section of the following it explains how to remove potentially conflicting containers which I followed to remove my occurrence of this issue. https://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
upgrade the docker-compose or reinstall it
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
It solves the problem for me.
In my case, docker-composer was missing. Installing it solved the issue.