Windows Installation
Below are the instructions to intall and run chain code on a windows machine.
For this installation, you should be prepared for some obstacles as installation on windows is not simple.
Pre-reqs
• Docker (https://docs.docker.com/desktop/windows/install/)
• cURL (https://curl.se/download.html)
• Go (https://go.dev/dl/)
• Node.js (https://nodejs.org/en/download/)
• Git (https://git-scm.com)
Download, if needed and check on each pre-requisite item
Validatation for pre-reqs
Run command prompt in admin mode (cmd) check all installations
Let's proceed to install other items
WSL (https://docs.microsoft.com/en-us/windows/wsl/install)
Use this command to install Windows Subsystem for Linux (WSL) - wsl –install
To update : WSL2 Linux kernel update package for x64 machines (https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi)
Use this command to validate installation wsl -l -v
Check Windows Feature if it has been installed, do check the Virtual Machine Platform, if not done set.
WSL and Virtual Machine Platform
Once done, log in Microsoft app store and download Ubantu and Windows Terminal
Run Windows Terminal under Admin mode
Below screen shows, how it looks after installation.
Note: Open Windows Terminal in Admin mode
Once Ubantu starts, it will ask for username and password.
Ubantu is picky with user names.. just like Unix, it needs to start with lower case (https://www.oreilly.com/library/view/practical-unix-and/0596003234/ch04s01.html)
Docker desktop app start
Run docker under admin mode and under setting-> resources see that Ubantu is selected (First time users, will have to create docker hub ID)
Make sure
- WSL 2 is checked
- Ubantu is being referenced
Enable Ubantu on docker container
Installing Hyperledger Fabric and Binaries
• Clone the hyperledger/fabric-samples repository.
I’m installing Hyperledger fabric version 2.2.0
curl -sSL http://bit.ly/2ysbOFE | bash -s -- <fabric_version> <fabric-ca_version> <thirdparty_version>
curl -sSL http://bit.ly/2ysbOFE | bash -s -- 2.2.0 1.4.9 0.4.22
Read this doc before you move ahead (https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/scenario.html)
Read this doc to aid in testing (https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html)
cd fabric-samples/test-network
Step by step testing and running chain code
Start the network with script file ./network.sh up
Note: run ./network.sh down
to take anything running down on docker.
check existing processes running by using : docker ps -a
Create mychannel ./network.sh up createChannel
Deploying the chain code ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript
Docker container showing images created
Note: in the end run ./network.sh down
to stop process. Check docker's to confirm all processes are stopped..
Top comments (0)