Not able to start a chaincode in the test-network - hyperledger-fabric

I got stuck with the first tutorial for the test-network. I can set up a network and a channel with the network.sh-script, checked it with ‘docker ps -a’.
But trying to start the chaincode with
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
fails. The console-output complains about inconsistent vendoring and suggests ignoring the vendoring directory:
console output with GOFLAGS='-mod=readonly
If I export ‘-mod=readonly’ before deploying the chaincode the error stays the same, exporting ‘-mod=mod’ produces an error about a failed normalization of the chaincode path:
console output with GOFLAGS='mod=mod'
I’m using linux-mint 20.2 (Uma), the prerequisites are of the following versions:
git 2.25.1
curl 7.68.0
docker 20.10.14
docker-compose 1.25.0 (build unknown)
go 1.13.8
jq 1.6
Setting up the network I once had the monitordocker-skript from the second tutorial running and noticed that it shows a different go-version (1.17.5 but still above the needed 1.13.x). And printing the version of docker-compose in the terminal there are the words “build unknown” behind the version-number, don’t know if that is useful.
Does anyone know why I’m not able to start a chaincode with the test-network?
Tried it with go 1.18, but there's no change.

Related

"Error getting endorser client for query" when trying cli interaction with hyperledger fabric example, despite successful installation

I'm currently trying to get the example for hyperledger fabric working. I get as far as starting the chaincode successfully using the deployCC script, and get the expected printout of all the cars after running the script. However, when I get to the next step of manually querying the network, I run into issue. I've run the exports for org1 as specified, and verified that the paths match and the tls cert and mspconfig exist in those locations. However, when I try to run the query command:
peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}'
I get the following error printout:
Error: error getting endorser client for query: endorser client failed to connect to 0.0.0.0:7051: failed to create new connection: context deadline exceeded
I would expect to get the same printout as at the end of the deployCC script, and I can't figure out why that isn't happening. Any help in diagnosing this is appreciated!
If it matters, I'm running this in a VM with Ubuntu 20.04. All the prerequisites are fresh installations of the latest versions from the last couple of days.
Liam, if you are able to see all the cars at the end of deployCC, then it might be an environment variables issue. Remember that you have to execute the peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}' command in the same terminal where you ran deployCC because the environment variables are all set in that window.
We can do a couple of things to confirm:
Paste the output from DeployCC at the end, right after (and including)
Querying chaincode on peer0.org1...
Using organization
Print the following environment variables from the terminal window where you are executing deployCC and from the terminal window where you are executing the peer chaincode query -C mychannel -n fabcar -c '{"Args":["queryAllCars"]}' command
CORE_PEER_LOCALMSPID,
CORE_PEER_TLS_ROOTCERT_FILE,
CORE_PEER_MSPCONFIGPATH,
CORE_PEER_ADDRESS.
See if they match?

hyperledger fabric devmode

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.

Hyperledger on IBM Cloud, chaincode launched and waiting for registration

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

Yet Another "ERROR: manifest for hyperledger/fabric-orderer:latest not found" error

Part of the answer (!) to this question is that I must know (in advance) that this is a problem, identify the images that I must pull (here's Orderer) and then retag them all with "latest". This seems sub-optimal. I know this problem because I've experienced it before, but... I'm being a noob and following along here:
Excited Noob wanting to write first app
Dutifully follows along with Prereqs
Then
/startFabric.sh
# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1
docker-compose -f docker-compose.yml down
Removing network net_basic
WARNING: Network net_basic not found.
docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Pulling orderer.example.com (hyperledger/fabric-orderer:latest)...
ERROR: manifest for hyperledger/fabric-orderer:latest not found
Noob departs frustrated?
Please revise the tutorial page to reference this additional pre-req
Or parameterize scripts to take DOCKER_TAG={{VALUE}}
Or am I missing something?
These instructions could be:
Identify the latest version for your architecture using "fabric-orderer" as a template:
https://hub.docker.com/r/hyperledger/fabric-orderer/tags/
In my case the latest tag is x86_64-1.0.3 and I'm using bash, so:
TAG={{THE CORRECT VALUE}} // In my case x86_64-1.0.3
for IMAGE in orderer couchdb peer ca tools
do
docker pull hyperledger/fabric-${IMAGE}:${TAG} && \
docker tag \
hyperledger/fabric-${IMAGE}:${TAG} \
hyperledger/fabric-${IMAGE}:latest
done
References:
ERROR: manifest for hyperledger/fabric-orderer:latest not found
hyperledger fabric tutoral - write first application error
Error building images: Tag latest not found in repository docker.io/hyperledger/fabric-baseimage
BlockChain : Issue setting up dev environment for hyperledger fabric
What you missing is the step where you have to download binaries, see "Download Platform-specific Binaries".
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.3.sh | bash
PS. you can find more explanation on one of your references, e.g.:
"hyperledger fabric tutoral - write first application error"

Error while updating business network in CLI tutorial

I am following along the Getting Started with Fabric Command Line and have run into a error I don't understand how to resolve. Any ideas?
In the section entitled "Update the deployed business network" an exception is thrown. The terminal output is below. The command used:
composer network update --archiveFile digitalproperty-network#0.0.7.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
Note that the id is different from the tutorial as the 0.0.7 id was reported during the previous step while creating. The output continued...
Deploying business network from archive digitalproperty-network#0.0.7.bna
Business network definition:
Identifier: digitalproperty-network#0.0.7
Description: Digital Property Network
events.js:160
throw er; // Unhandled 'error' event
^
Error
at ClientDuplexStream._emitStatusIfDone (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/home/mnjacobs/.nvm/versions/node/v6.9.5/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:217:12)
I've struggled to get the versions to match the tutorials - they seem inconsistent. Notably, the node (v6.9.5) and nodejs (v6.10.1) versions differ even though node is a symbolic link to nodejs and I notice 6.9.5 is in the stack trace. I'm not sure that difference is relevant to the problem.
Other version information:
Ubuntu 14.04.5
Docker version 17.03.1-ce, build c6d412e (manually installed as auto
install was down level)
docker-compose version 1.12.0-rc2, build 08dc2a4
I've seen exactly that error when Hyperledger Fabric isn't running. If docker ps doesn't show anything, run npm run startHLF in the sample-applications/packages/getting-started directory before trying again.

Resources