github.com/true-sqn/fabric@v2.1.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  Developing on Windows
    27  ~~~~~~~~~~~~~~~~~~~~~
    28  
    29  On Windows 10 you should use the native Docker distribution and you
    30  may use the Windows PowerShell. However, for the ``binaries``
    31  command to succeed you will still need to have the ``uname`` command
    32  available. You can get it as part of Git but beware that only the
    33  64bit version is supported.
    34  
    35  Before running any ``git clone`` commands, run the following commands:
    36  
    37  ::
    38  
    39      git config --global core.autocrlf false
    40      git config --global core.longpaths true
    41  
    42  You can check the setting of these parameters with the following commands:
    43  
    44  ::
    45  
    46      git config --get core.autocrlf
    47      git config --get core.longpaths
    48  
    49  These need to be ``false`` and ``true`` respectively.
    50  
    51  The ``curl`` command that comes with Git and Docker Toolbox is old and
    52  does not handle properly the redirect used in
    53  :doc:`getting_started`. Make sure you have and use a newer version
    54  which can be downloaded from the `cURL downloads page
    55  <https://curl.haxx.se/download.html>`__
    56  
    57  Clone the Hyperledger Fabric source
    58  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    59  
    60  -  (macOS) `Libtool <https://www.gnu.org/software/libtool/>`__. You can use
    61     Homebrew to install it as follows:
    62  
    63  ::
    64  
    65      brew install libtool
    66  
    67  -  (only if using Vagrant) - `Vagrant <https://www.vagrantup.com/>`__ -
    68     1.9 or later
    69  -  (only if using Vagrant) -
    70     `VirtualBox <https://www.virtualbox.org/>`__ - 5.0 or later
    71  -  BIOS Enabled Virtualization - Varies based on hardware
    72  
    73  -  Note: The BIOS Enabled Virtualization may be within the CPU or
    74     Security settings of the BIOS
    75  
    76  
    77  Steps
    78  ~~~~~
    79  
    80  Set your GOPATH
    81  ^^^^^^^^^^^^^^^
    82  
    83  Make sure you have properly setup your Host's `GOPATH environment
    84  variable <https://github.com/golang/go/wiki/GOPATH>`__. This allows for
    85  both building within the Host and the VM.
    86  
    87  In case you installed Go into a different location from the standard one
    88  your Go distribution assumes, make sure that you also set `GOROOT
    89  environment variable <https://golang.org/doc/install#install>`__.
    90  
    91  Note to Windows users
    92  ^^^^^^^^^^^^^^^^^^^^^
    93  
    94  If you are running Windows, before running any ``git clone`` commands,
    95  run the following command.
    96  
    97  ::
    98  
    99      git config --get core.autocrlf
   100  
   101  If ``core.autocrlf`` is set to ``true``, you must set it to ``false`` by
   102  running
   103  
   104  ::
   105  
   106      git config --global core.autocrlf false
   107  
   108  If you continue with ``core.autocrlf`` set to ``true``, the
   109  ``vagrant up`` command will fail with the error:
   110  
   111  ``./setup.sh: /bin/bash^M: bad interpreter: No such file or directory``
   112  
   113  Cloning the Hyperledger Fabric source
   114  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   115  
   116  First navigate to https://github.com/hyperledger/fabric and fork the
   117  fabric repository using the fork button in the top-right corner
   118  
   119  Since Hyperledger Fabric is written in ``Go``, you'll need to
   120  clone the forked repository to your $GOPATH/src directory. If your $GOPATH
   121  has multiple path components, then you will want to use the first one.
   122  There's a little bit of setup needed:
   123  
   124  ::
   125  
   126      cd $GOPATH/src
   127      mkdir -p github.com/<your_github_userid>
   128      cd github.com/<your_github_userid>
   129      git clone https://github.com/<your_github_userid>/fabric
   130  
   131  If you plan to use the Hyperledger Fabric application SDKs then be sure to check out their prerequisites in the Node.js SDK `README <https://github.com/hyperledger/fabric-sdk-node#build-and-test>`__ and Java SDK `README <https://github.com/hyperledger/fabric-gateway-java/blob/master/README.md>`__.
   132  
   133  .. Licensed under Creative Commons Attribution 4.0 International License
   134     https://creativecommons.org/licenses/by/4.0/