What is the Hyperledger fabric?
Though documents say that hyper ledger fabric works on the windows, I can't find it running in well. I tried hard to run it but failed. But I found another way to run the hyper ledger on windows with Linux subsystem which has been officially available in windows 10.
(Video Guide )
Requirement
windows 10 Pro
Docker CE
PowerShell
Nodejs
Go 1.9
Basic Setup ( Step - 1 )
The first step to set up the hyperedge fabric on windows is to enable the Linux subsystem
1. Enable the Linux subsystem on your windows
What is the Hyperledger fabric?
Though documents say that hyper ledger fabric works on the windows, I can't find it running in well. I tried hard to run it but failed. But I found another way to run the hyper ledger on windows with Linux subsystem which has been officially available in windows 10.
(Video Guide )
Requirement
windows 10 ProDocker CE
PowerShell
Nodejs
Go 1.9
Basic Setup ( Step - 1 )
Enable Linux SubSystem |
2. Install your favourite Linux subsystem from the store ( i prefer ubuntu )
Add Ubuntu Linux Subsystem |
3. Install Docker
Install Docker |
( Docker Requires Hyper-V to run so enable hyper-v )
( Afer installation reboot the system )
Configure Docker to work with Linux subsystem
Make the docker runningStart Docker
( Run the docker as Linux container)
Docker as Linux container |
If you get the not enough memory
Not Enough Memory error |
( It will definitely start and if not then you have to add more ram to your system )
Update docker settings |
We need to expose the daemon to port 2375 in the setting.
Expose daemon to port 2375 |
Share the drive so we can mount that drive in our Linux subsystem to use it with the docker.
Share drive docker |
Share drive windows |
Setup the hyper ledger in the Linux subsystem
Now open the Linux subsystem and follow the steps
Ubuntu Linux subsystem |
First of all check for the update
$ sudo apt-get update
Update ubuntu |
Install curl
$ sudo apt-get install curl
Install Curl on ubuntu |
we are going to use curl to fetch docker images from the server using the curl
install docker-compose to connect the docker we have installed on windows with the Linux subsystem
$ sudo apt install docker-compose
install node js and npm
$ sudo apt update
$ sudo apt install nodejs
$ sudo apt install npm
Now,
we have to mount the d drive to our Linux subsystem
There is a workaround for mounting /mnt/d to /d
if you drive has successfully mounted then you will be able to see the content of your drive in the ls command from the Linux subsystem.
Verify mounting of drive |
Create a new folder in the drive which you want to use as your hyper ledger fabric workspace.
Create workspace |
Move to the directory you have created and pull in the sample project from the GitHub there.
$ git clone https://github.com/hyperledger/fabric-samples.git
install the docker images of the hyper ledger fabric
curl -sSL https://goo.gl/byy2Qj | bash -s 1.0.5
You have successfully installed the hyper ledger fabric. You can test it using running any sample project provided there.
We will test using the First-network project
First of all, generate a sample network using
./byfn -m generate
Make the network up
./byfn -m up
Hope Find it useful,
If you need any help just comment. I will be happy to help
Follow your each step but showing error:
ReplyDelete"ERROR! Local Fabric binary version of 1.0.5 does not match this newer version of BYFN and is unsupported. Either move to a later version of Fabric or checkout an earlie
r version of fabric-samples."
Will you please provide recent version
Abhisek , I will make it update as soon as possible.
DeleteThis post is to show that you can do hyperledger fabrci development on windows. But, If you are developing somthing serious please don't use winodws. Instead go with liunux [ may be with virtulbox / vmware ]. Please see this post https://www.mchampaneri.in/2018/03/setup-development-environment-for.html
Deletethank you, your info supplement the official doc
ReplyDeleteHi Manish,
ReplyDeleteAt last step i'm getting error "curl: (3) Host name ' bash' contains bad letter"
can you please advise.
Thanks
Rajesh
That is very interesting; you are a very skilled blogger. I have shared your website in my social networks! A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article.
ReplyDeleteBest Quoting Software