Setting up the development environment¶
- Git client, Go, and Docker as described at Prerequisites
- (macOS) Xcode must be installed
- (macOS) you may need to install gnutar, as macOS comes with bsdtar as the default, but the build uses some gnutar flags. You can use Homebrew to install it as follows:
brew install gnu-tar
- (macOS) If you install gnutar, you should prepend the “gnubin” directory to the $PATH environment variable with something like:
- (macOS) Libtool. You can use Homebrew to install it as follows:
brew install libtool
Set your GOPATH¶
Make sure you have properly setup your Host’s GOPATH environment variable. This allows for both building within the Host and the VM.
In case you installed Go into a different location from the standard one your Go distribution assumes, make sure that you also set GOROOT environment variable.
Note to Windows users¶
If you are running Windows, before running any
git clone commands,
run the following command.
git config --get core.autocrlf
core.autocrlf is set to
true, you must set it to
git config --global core.autocrlf false
If you continue with
core.autocrlf set to
vagrant up command will fail with the error:
./setup.sh: /bin/bash^M: bad interpreter: No such file or directory
Cloning the Hyperledger Fabric source¶
First navigate to https://github.com/hyperledger/fabric and fork the fabric repository using the fork button in the top-right corner
Since Hyperledger Fabric is written in
Go, you’ll need to
clone the forked repository to your $GOPATH/src directory. If your $GOPATH
has multiple path components, then you will want to use the first one.
There’s a little bit of setup needed:
cd $GOPATH/src mkdir -p github.com/<your_github_userid> cd github.com/<your_github_userid> git clone https://github.com/<your_github_userid>/fabric