github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/docs/source/dev-setup/devenv.rst (about)

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