github.com/kaituanwang/hyperledger@v2.0.1+incompatible/docs/source/dev-setup/devenv.rst (about) 1 Setting up the development environment 2 -------------------------------------- 3 4 Prerequisites 5 ~~~~~~~~~~~~~ 6 7 - Git client, Go, and Docker as described at :doc:`../prereqs` 8 - (macOS) 9 `Xcode <https://itunes.apple.com/us/app/xcode/id497799835?mt=12>`__ 10 must be installed 11 - (macOS) you may need to install gnutar, as macOS comes with bsdtar 12 as the default, but the build uses some gnutar flags. You can use 13 Homebrew to install it as follows: 14 15 :: 16 17 brew install gnu-tar 18 19 - (macOS) If you install gnutar, you should prepend the "gnubin" 20 directory to the $PATH environment variable with something like: 21 22 :: 23 24 export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH 25 26 - (macOS) `Libtool <https://www.gnu.org/software/libtool/>`__. You can use 27 Homebrew to install it as follows: 28 29 :: 30 31 brew install libtool 32 33 - (only if using Vagrant) - `Vagrant <https://www.vagrantup.com/>`__ - 34 1.9 or later 35 - (only if using Vagrant) - 36 `VirtualBox <https://www.virtualbox.org/>`__ - 5.0 or later 37 - BIOS Enabled Virtualization - Varies based on hardware 38 39 - Note: The BIOS Enabled Virtualization may be within the CPU or 40 Security settings of the BIOS 41 42 43 Steps 44 ~~~~~ 45 46 Set your GOPATH 47 ^^^^^^^^^^^^^^^ 48 49 Make sure you have properly setup your Host's `GOPATH environment 50 variable <https://github.com/golang/go/wiki/GOPATH>`__. This allows for 51 both building within the Host and the VM. 52 53 In case you installed Go into a different location from the standard one 54 your Go distribution assumes, make sure that you also set `GOROOT 55 environment variable <https://golang.org/doc/install#install>`__. 56 57 Note to Windows users 58 ^^^^^^^^^^^^^^^^^^^^^ 59 60 If you are running Windows, before running any ``git clone`` commands, 61 run the following command. 62 63 :: 64 65 git config --get core.autocrlf 66 67 If ``core.autocrlf`` is set to ``true``, you must set it to ``false`` by 68 running 69 70 :: 71 72 git config --global core.autocrlf false 73 74 If you continue with ``core.autocrlf`` set to ``true``, the 75 ``vagrant up`` command will fail with the error: 76 77 ``./setup.sh: /bin/bash^M: bad interpreter: No such file or directory`` 78 79 Cloning the Hyperledger Fabric source 80 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 81 82 First navigate to https://github.com/hyperledger/fabric and fork the 83 fabric repository using the fork button in the top-right corner 84 85 Since Hyperledger Fabric is written in ``Go``, you'll need to 86 clone the forked repository to your $GOPATH/src directory. If your $GOPATH 87 has multiple path components, then you will want to use the first one. 88 There's a little bit of setup needed: 89 90 :: 91 92 cd $GOPATH/src 93 mkdir -p github.com/<your_github_userid> 94 cd github.com/<your_github_userid> 95 git clone https://github.com/<your_github_userid>/fabric 96 97 .. Licensed under Creative Commons Attribution 4.0 International License 98 https://creativecommons.org/licenses/by/4.0/