I'm setting up the development environment of Hyperledger Fabric following the tutorial:
Running chaincode in development mode
I had cloned the fabric folder and set up the development environment for the an orderer and a peer, they are both performing well. However, I had set them both on my PC's environment together, not separately in different docker containers. Following the instructions, I had created the channel and started the sample chaincode as well.
However, when I run this command in the "Next Steps" part of the tutorial:
CORE_PEER_ADDRESS=127.0.0.1:7051 peer chaincode invoke -o 127.0.0.1:7050 -C ch -n mycc -c '{"Args":["init","a","100","b","200"]}' --isInit
an error occurred:
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction bc2357ccb38b3abcca2499210a9f380c4263d186fe8e7bd974c7875ce4a7f8c4: could not launch chaincode mycc:1.0: error building chaincode: error building image: failed to get chaincode package for external build: could not get legacy chaincode package 'mycc:1.0': open /var/hyperledger/production/chaincodes/mycc.1.0: no such file or directory"
I'm a new beginner and get really confused about this. Do I need to set the peer node and orderer node separately in two docker containers? Or do I have to change the route of mycc.1.0 used by this command?
It seems that the peer doesn't install mycc, run peer chaincode list --installed to find out
Related
I am doing the Hyperledger Fabric Tutorial: Running a Fabric Application and I am at the Set up the Blockchain network section. I am using M1 MacBook Pro, and I need to deploy the chaincode using
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
Unfortunately it failed with the result
Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: docker build failed: Failed to pull hyperledger/fabric-nodeenv:2.3: no matching manifest for linux/arm64/v8 in the manifest list entries
Chaincode installation on peer0.org1 has failed
Deploying chaincode failed
I am very new to docker and hyperledger fabric, so I am unsure what I should do regarding docker failing to pull hyperledger/fabric-nodeenv:2.3, and the problem with linux/arm64/v8 not in the manifest list entries.
Note that I am using M1 MacBook Pro and this is my current machine and the operating system running on it:
Darwin Edmunds-MBP 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101 x86_64
You can pull the image with linux platform first, before run command from the tutorial.
docker pull --platform linux/x86_64 hyperledger/fabric-nodeenv:2.3
I had the same issue and I tried to resolve the issue for days. Here is what you need to do:
Before you run:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
Run this command:
docker pull --platform linux/x86_64 hyperledger/fabric-javaenv:2.4
After that run the chaincode initialization command again.
When I try to execute a build of the images of Syndesis using Minishift, it finishes with this error:
[ERROR] Failed to execute goal
io.fabric8:fabric8-maven-plugin:3.5.38:build (exec) on project s2i:
Failed to execute the build: Unable to build the image using the
OpenShift build service: Can't instantiate binary build, due to error
reading/writing stream. Can be caused if the output stream was closed
by the server. Connection reset
I cheched that minishift is running with "minishift status":
$ minishift status
Minishift: Running
Profile: minishift
OpenShift: Running (openshift v3.11.0+82a43f6-231)
DiskUsage: 76% of 20G (Mounted On: /mnt/sda1)
CacheUsage: 1.679 GB (used by oc binary, ISO or cached images)
and checked that the proper project/pods are installed with "oc get pods" command.
The problem was that minishift was running out of space.
I could recover some space with the command
$ syndesis dev --cleanup
When you do this, make sure the nip.io domains work on your machine. If that's not the case, add the following entry to your /etc/hosts:
$IP $IP.nip.io syndesis.$IP.nip.io docker-registry-default.$IP.nip.io
where $IP is the IP of minishift, which you can find with:
$ minishift ip
192.168.42.58
I am trying to Install Hyperledger composer on Mac OS by using this tutorial.
When I run the following command from tutorial
composer network start --networkName tutorial-network --networkVersion
0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card
PeerAdmin#hlfv1 --file networkadmin.card
I get the following error
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
When I check my Docker Logs. I have the following errors
I would like to know is there a way I can pass .npmrc file to docker to solve this problem ?
Can I set NODE_TLS_Unauthorized=0 as environment variable and give it to Docker ?
Are there any work around solution from which i can solve the problem?
Notes:
I have provided .npmrc in the following command
composer network install --card PeerAdmin#hlfv1 --archiveFile tutorial-
network#0.0.1.bna -o npmrcFile=/Users/1/.npmrc
I have the following .npmrc file
always-auth=true
strict-ssl=false
ca=
loglevel=verbose
proxy= myproxy
https-proxy=myproxy
unsafe-perm=true
NODE_TLS_REJECT_UNAUTHORIZED=0
registry=http://registry.npmjs.org/
I am running all the applications behind corporate firewall as well as in Mac OS
You can pass an npmrc file as part of the composer network install command. When fabric builds the chaincode image for the business network it will use that npmrc file as part of the npm install it performs, see
https://hyperledger.github.io/composer/latest/managing/connector-information
for more information about the CLI options.
I am getting an error after running script ./byfn.sh -m up
Error: error getting endorser client chaincode: endorser client failed to connect to peer0.org1.example.com:7051 failed to create new connection context deadline exceeded.
Please check if the peer container is still up. If the container has crashed, then it cannot be reached for endorsement. Also checking the logs for peer0.org1.example.com will help.
first you have to run .byfn.sh -m down it will delete all old configuration of docker and container images,
now you can run .byfn.sh -m up , by using this command you can up your network in hyperledger.
You simply have to do ./byfn.sh up and it will work. No need to use -m flag but first try to do ./byfn.sh down so it cleans itself.
If you want a detailed study on byfn read this blog here
I'm trying to run the docker-compose up command, but I'm getting an error from the grpc logger. I'm following the steps given on this website and I'm stuck at step 4 (Start the blockchain network).
I tried various images for the fabric peer, for example:
hyperledger/fabric-peer:x86_64-1.0.1
hyperledger/fabric-peer
hyperledger/fabric-peer:x86_64-1.0.0-rc1
etc.
Here is my docker-compose.yml file for the fabric image:
vp0:image: "hyperledger/fabric-peer:x86_64-1.0.1"
I get the following error when running docker-compose up:
DEBU 1a9 Module 'grpc' logger enabled for log level 'ERROR'
How can I fix this problem?
looks more like a statement than a real ERROR. If you run docker ps are your containers running?