Error when trying to bring up the test network - hyperledger-fabric

I trying to follow tutorials and develope on Ubuntu. Then get an error when comes to "Bring up the test network" part. I successfully run the following command to print the script help text of the test network.
./network.sh -h
When I want to run the next command to bring up the network
./network.sh up
I get the message as follow
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' with crypto from 'cryptogen'
ERROR! Peer binary and configuration files not found..
May somebody tells me what's happened? Kindly helps.

I had the same issue, looks like you need to fetch system specific binaries:
https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html
I ran the curl command in the root dir without specifying the versions.
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s
Make sure you add the ./bin to .gitignore

Be sure to use
./network.sh up
from the test network folder and that test network folder is contained in fabric samples, because it could use binaries from different directories contained inside fabric samples and moving it could cause your error.
Also try to set this environment variable
FABRIC_CFG_PATH=$PWD
to force Fabric to be launched in your test network folder

first bring down the network to clean up
cd test-network
./network.sh down
start the network agian
./network.sh up

Before you can deploy the test network, you need to follow the instructions to Install the Samples, Binaries and Docker Images in the Hyperledger Fabric documentation.

Related

I am trying to run hyperledger fabric sample test network on windows 11

when executing "/network.sh up", I got this:
-bash: /network.sh: no such file or directory
how can I fix this?
I need to get the network up
You say you are trying to run /network.sh. This will try to run a network.sh script in the root directory of your filesystem. More likely you meant to type ./network.sh, which will run a network.sh script in your current working directory (. is interpreted by the shell as the current directory).
You give no details of how your environment is set up so make sure you are following the guidance on running in Windows provided by the Fabric documentation:
https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#windows
Essentially the recommendation is to run on Linux within a (Windows Subsystem for Linux) virtual machine. I personally run Docker within the Linux environment too, and don't use Docker Desktop for Windows. Either approach should work.

Deploying Chaincode Failed

I was following the tutorial of hyperledger fabric "Using the Fabric Test Network", ang upon deploying the chaincode to the channel I encountered errors that I don't know what's the problem with it. I tried everything I have searched so far but no luck on fixing it. I tried uninstalling everything, and starting from the beginning of the installation but again no luck. I am new to this blockchain platform and is an aspiring developer for it. Anyone Please help.
Here is the result upon running the chaincode deployment :
Please do note that I tried installing golang (go1.13.x versions, go1.18.x and go1.19.x)but none solved the problem, anybody please help.
The screenshot shows that you don't have golang on the path. You need to ensure your $PATH variable includes the directory where the go binary is installed. However a further issue is you must ensure that the correct version of Go is installed that matches the version of Hyperledger Fabric you are using. Refer to the release notes of Hyperledger Fabric found here https://github.com/hyperledger/fabric/releases for your version to determine the appropriate version of golang to use.
A simpler option would be to install the javascript chaincode rather than the Go chaincode as this doesn't require any language support to be installed
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript
I see this error in your screenshot:
go: command not found
Check you can run go from your shell:
go version
You likely need to add the go executable to your shell's PATH, as described in the Go installation instructions.

Installation error while installing test corda node

i am trying to create a corda test node using the following link:
Corda Azure VM
I have followed the instruction as is and when i execute the command from "https://marketplace.r3.com/network" with their onetime script in the terminal sudo ONE_TIME_DOWNLOAD_KEY=91c51b4e-d619-4a20-90c1-24120687a74d bash -c "$(curl -L https://onboarder.prod.ws.r3.com/api/user/node/TESTNET/install.sh)"
I get the following error
any idea on how to solve this
I assume that you're talking about the last line (No such file or directory) since I don't see any errors really.
So the corda.service file allows you to start your Corda node when your VM starts, if it's missing; then you have to start the node manually.
I recommend that you follow the instructions in this link to create the file yourself (start at step number 8): https://docs.corda.net/deploying-a-node.html#linux-installing-and-running-corda-as-a-system-service
Please note that there are 2 approaches to create a service (SystemD and Upstart); so make sure that you follow the steps for only one approach (I used SystemD).

Issue bringing up Hyperledger Fabric "Building Your First Network" sample

while I am running this command from my terminal
sudo ./byfn.sh -m up
I am getting below error:
Starting with channel 'my-channel' and CLI timeout of '10' seconds
and CLI delay of '3' seconds Continue (y/n)? y proceeding ...
Pulling orderer.example.com (hyper-ledger/fabric-orderer:latest)...
ERROR: manifest for hyper-ledger/fabric-orderer:latest not found
ERROR !!!! Unable to start network Error response from daemon: No
such container: cli
How do I resolve this please?
You need to download platform specific binaries, please see how to do it here in the following tutorial. Please also make sure you have all per-requisites, you can find more about what needed here.
Ideally, you should download the platform binaries and images as given in the Fabric documentation - Install Binaries and Docker Images
Or
You should make sure that your terminal has internet access & not behind any corporate proxy. Whatever is needed would be pulled by docker anyway. I am guessing that hyperledger/fabric-baseos image is not pulled by the script above.
If you don't find hyperledger/fabric-baseos:latest,then either docker pull hyperledger/fabric-baseos:tag depends on the fabric version on your own
Or, the chaincode instantiate process in byfn- end to end CLI would do it for you.
I had the same issue. Turns out it was just a broken docker-compose installation. I simply figured it out typing docker-compose in my terminal, and I ran into ImportError: No module named ssl_match_hostname
With a clean docker compose install, I got it to work.

How do I resolve the error on hyperledger fabric?

While trying to follow tutorial on building your first network I've got following output:
$ ./byfn.sh -m generate
Generating certs and genesis block for with channel 'mychannel' and CLI timeout of '10000'
Continue (y/n)? y
proceeding ...
which: no cryptogen in (/c/users/ayush/fabric-samples/first-network/../bin:/c/users/ayush/fabric-samples/first-network:c:/users/ayush/bin:/c/Users/ayush/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Program Files/Docker Toolbox:/c/Users/ayush/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/ayush/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files/Docker/Docker/Resources/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/cmd:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Gradle/gradle-3.3/bin:/c/Go/bin:/c/Program Files/nodejs:/c/Users/ayush/AppData/Local/Programs/Python/Python36/Scripts:/c/Users/ayush/AppData/Local/Programs/Python/Python36:/c/Users/ayush/AppData/Local/Microsoft/WindowsApps:/c/python:/c/Program Files/Docker Toolbox:/c/Users/ayush/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
cryptogen tool not found. exiting
What is the problem and how can I get it solved?
The key of you problem is in the last sentence:
cryptogen tool not found. exiting
You need to make sure to have cryptogen tool compiled prior to trying run the example with ./byfn.sh. Just run from fabric home folder:
make cryptogen configtxgen peer orderer peer-docker orderer-docker tools-docker
Update
You are missing: "Platform specific binaries", see here how to get them.
If you're using a mac, do the following in terminal:
brew tap hyperledger/fabric
brew install fabric-tools
and then try again with ./byfn.sh -m generate command
I got the answer now.
This issue is caused by the lack of cryptogen, which is indeed a command tool. The simplest way to get it is to download the platform specific binaries into your local machine,
here is the sh:
cd fabric-samples
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.1.sh | bash
This sh will download a bash file which would pull the latest Fabric docker images and the platform specific tools, its content is as below:
#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
export VERSION=1.0.1
export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}')
#Set MARCH variable i.e ppc64le,s390x,x86_64,i386
MARCH=`uname -m`
dockerFabricPull() {
local FABRIC_TAG=$1
for IMAGES in peer orderer couchdb ccenv javaenv kafka zookeeper tools; do
echo "==> FABRIC IMAGE: $IMAGES"
echo
docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES
done
}
dockerCaPull() {
local CA_TAG=$1
echo "==> FABRIC CA IMAGE"
echo
docker pull hyperledger/fabric-ca:$CA_TAG
docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
}
: ${CA_TAG:="$MARCH-$VERSION"}
: ${FABRIC_TAG:="$MARCH-$VERSION"}
echo "===> Downloading platform binaries"
curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz
echo "===> Pulling fabric Images"
dockerFabricPull ${FABRIC_TAG}
echo "===> Pulling fabric ca Image"
dockerCaPull ${CA_TAG}
echo
echo "===> List out hyperledger docker images"
docker images | grep hyperledger*
Now it is based on Fabric 1.0.1, you can find the latest version of this bash from here :
http://hyperledger-fabric.readthedocs.io/en/latest/samples.html
After the sh execution is completed, there will be a folder named bin in current directory, then copy the files under this folder into a searchable folder, such as
cp ./bin/* $GOROOT/bin
Then you can test if the cryptogen exists by type command:
which cryptogen
The main problem is in the last line of error which says
"cryptogen tool not found. exiting"
Please follow below steps to resolve this issue-
Download the platform-specific binaries using command
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/v1.0.5/scripts/bootstrap.sh | bash -s 1.0.5
Once you run the command it will download various tools like cryptogen, configtxgen etc under bin directory.
add the bin directory to your PATH variable using below command
export PATH=$PATH:[path-to-bin-directory]
now try to build the network again.
I hope this helps someone.
Please follow below steps to resolve this issue:
1.Download the platform-specific binaries using command
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.1.0"
Once you run the command it will download various tools like cryptogen, configtxgen etc under bin directory.
1.add the bin directory to your PATH variable using below command
export PATH=./bin:$PATH
Step1: cd fabric-samples
Step2:
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/v1.0.5/scripts/bootstrap.sh | bash -s 1.0.5
Step3: cd fabric-samples/first-network
Step4: ./byfn.sh -m generate
You will see a brief description as to what will occur, along with a yes/no command line prompt. Respond with a y or hit the return key to execute the described action.
Not sure if its still an issue or not.....
You can either try to use what #Artem already mentioned,
or
you can add the ......fabric-samples/bin folder to your path, which has the tools. its the same fabric-samples folder that has the byfn.sh
cryptogen command is under the bin directory where you installed (or uncompressed) the fabric tarball. So you just need to update your $PATH variable so that the shell knows where the cryptogen command can be found.
This code should work:
export "$PATH:/<home>/<fabric>/bin"
Where <home> is your home directory, such as /home/sindelio
and <fabric> is where the fabric was installed.
Unless you close the terminal, following solution works:
export PATH=$PATH:PATH_TO_FABRIC_SAMPLES/bin
Probably have missed this Step
Download Platform-specific Binaries
https://hyperledger-fabric.readthedocs.io/en/release-1.1/samples.html
run command in
cd Fabric-Samples
Download the platform-specific binaries after cd into your workspace.
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/v1.4.0/scripts/bootstrap.sh | bash
and make sure your version of binaries matches your configuration file.

Resources