-
cURL — latest version
-
Docker — version 17.06.2-ce or greater DOCKER INSTALLATION
-
Docker Compose — version 1.14.0 or greater
-
Golang — version 1.11.x GOLANG INSTALLATION
-
Nodejs — version 8.x (other versions are not in support yet)
-
NPM — version 5.x
-
Python
-
Check Docker and Docker Compose versions / if installed properly
mkdir fabric
cd fabric
- To get the install script:
curl -sSLO https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh && chmod +x install-fabric.sh
- To pull the Docker containers and clone the samples repo, run one of these commands for example
./install-fabric.sh docker samples binary
or
./install-fabric.sh d s b
-
if you get permission denied error , become a super user
sudo su
then again try above cmd -
If done correctly :
-
cd fabric-samples/test-network
(inside fabric direc) -
In this directory, you can find an annotated script, network.sh, that stands up a Fabric network using the Docker images on your local machine
-
From inside the test-network directory, run the following command to remove any containers or artifacts from any previous runs:
./network.sh down
You can then bring up the network by issuing the following command. You will experience problems if you try to run the script from another directory:
./network.sh up
- OR you can also bring up the network with Certificate Authorities.
./network.sh up -ca
- Error in creating a channel (have to troubleshoot)
Error: Post "https://localhost:7053/participation/v1/channels": dial tcp 127.0.0.1:7053: connect: connection refused
Channel 'mychannel' created
Joining org1 peer to the channel...
Using organization 1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
+ peer channel join -b ./channel-artifacts/mychannel.block
+ res=1
Error: error getting endorser client for channel: endorser client failed to connect to localhost:7051: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:7051: connect: connection refused"
After 5 attempts, peer0.org1 has failed to join channel 'mychannel'
-
Solution : was running old version of HLF (2.2)
-
You can use the network.sh script to create a channel between Org1 and Org2 and join their peers to the channel. Run the following command to create a channel with the default name of mychannel:
./network.sh createChannel
- If done correctly , you will see following message in logs :