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

     1  Prerequisites
     2  =============
     3  
     4  Before we begin, if you haven't already done so, you may wish to check that
     5  you have all the prerequisites below installed on the platform(s)
     6  on which you'll be developing blockchain applications and/or operating
     7  Hyperledger Fabric.
     8  
     9  Install Git
    10  -----------
    11  Download the latest version of `git
    12  <https://git-scm.com/downloads>`_ if it is not already installed,
    13  or if you have problems running the curl commands.
    14  
    15  Install cURL
    16  ------------
    17  
    18  Download the latest version of the `cURL
    19  <https://curl.haxx.se/download.html>`__ tool if it is not already
    20  installed or if you get errors running the curl commands from the
    21  documentation.
    22  
    23  .. note:: If you're on Windows please see the specific note on `Windows
    24     extras`_ below.
    25  
    26  Docker and Docker Compose
    27  -------------------------
    28  
    29  You will need the following installed on the platform on which you will be
    30  operating, or developing on (or for), Hyperledger Fabric:
    31  
    32    - MacOSX, \*nix, or Windows 10: `Docker <https://www.docker.com/get-docker>`__
    33      Docker version 17.06.2-ce or greater is required.
    34    - Older versions of Windows: `Docker
    35      Toolbox <https://docs.docker.com/toolbox/toolbox_install_windows/>`__ -
    36      again, Docker version Docker 17.06.2-ce or greater is required.
    37  
    38  You can check the version of Docker you have installed with the following
    39  command from a terminal prompt:
    40  
    41  .. code:: bash
    42  
    43    docker --version
    44  
    45  .. note:: The following applies to linux systems running systemd.
    46  
    47  Make sure the docker daemon is running.
    48  
    49  .. code:: bash
    50  
    51    sudo systemctl start docker
    52  
    53  Optional: If you want the docker daemon to start when the system starts, use the following:
    54  
    55  .. code:: bash
    56  
    57    sudo systemctl enable docker
    58  
    59  Add your user to the docker group.
    60  
    61  .. code:: bash
    62  
    63    sudo usermod -a -G docker <username>
    64  
    65  .. note:: Installing Docker for Mac or Windows, or Docker Toolbox will also
    66            install Docker Compose. If you already had Docker installed, you
    67            should check that you have Docker Compose version 1.14.0 or greater
    68            installed. If not, we recommend that you install a more recent
    69            version of Docker.
    70  
    71  You can check the version of Docker Compose you have installed with the
    72  following command from a terminal prompt:
    73  
    74  .. code:: bash
    75  
    76    docker-compose --version
    77  
    78  .. _Golang:
    79  
    80  Go Programming Language
    81  -----------------------
    82  
    83  Hyperledger Fabric uses the Go Programming Language for many of its
    84  components.
    85  
    86    - `Go <https://golang.org/dl/>`__ version 1.12.x is required.
    87  
    88  Given that we will be writing chaincode programs in Go, there are two
    89  environment variables you will need to set properly; you can make these
    90  settings permanent by placing them in the appropriate startup file, such
    91  as your personal ``~/.bashrc`` file if you are using the ``bash`` shell
    92  under Linux.
    93  
    94  First, you must set the environment variable ``GOPATH`` to point at the
    95  Go workspace containing the downloaded Fabric code base, with something like:
    96  
    97  .. code:: bash
    98  
    99    export GOPATH=$HOME/go
   100  
   101  .. note:: You **must** set the GOPATH variable
   102  
   103    Even though, in Linux, Go's ``GOPATH`` variable can be a colon-separated list
   104    of directories, and will use a default value of ``$HOME/go`` if it is unset,
   105    the current Fabric build framework still requires you to set and export that
   106    variable, and it must contain **only** the single directory name for your Go
   107    workspace. (This restriction might be removed in a future release.)
   108  
   109  Second, you should (again, in the appropriate startup file) extend your
   110  command search path to include the Go ``bin`` directory, such as the following
   111  example for ``bash`` under Linux:
   112  
   113  .. code:: bash
   114  
   115    export PATH=$PATH:$GOPATH/bin
   116  
   117  While this directory may not exist in a new Go workspace installation, it is
   118  populated later by the Fabric build system with a small number of Go executables
   119  used by other parts of the build system. So even if you currently have no such
   120  directory yet, extend your shell search path as above.
   121  
   122  Node.js Runtime and NPM
   123  -----------------------
   124  
   125  If you will be developing applications for Hyperledger Fabric leveraging the
   126  Hyperledger Fabric SDK for Node.js, version 8 is supported from 8.9.4 and higher.
   127  Node.js version 10 is supported from 10.15.3 and higher.
   128  
   129    - `Node.js <https://nodejs.org/en/download/>`__ download
   130  
   131  .. note:: Installing Node.js will also install NPM, however it is recommended
   132            that you confirm the version of NPM installed. You can upgrade
   133            the ``npm`` tool with the following command:
   134  
   135  .. code:: bash
   136  
   137    npm install npm@5.6.0 -g
   138  
   139  Python
   140  ^^^^^^
   141  
   142  .. note:: The following applies to Ubuntu 16.04 users only.
   143  
   144  By default Ubuntu 16.04 comes with Python 3.5.1 installed as the ``python3`` binary.
   145  The Fabric Node.js SDK requires an iteration of Python 2.7 in order for ``npm install``
   146  operations to complete successfully.  Retrieve the 2.7 version with the following command:
   147  
   148  .. code:: bash
   149  
   150    sudo apt-get install python
   151  
   152  Check your version(s):
   153  
   154  .. code:: bash
   155  
   156    python --version
   157  
   158  .. _windows-extras:
   159  
   160  Windows extras
   161  --------------
   162  
   163  If you are developing on Windows 7, you will want to work within the
   164  Docker Quickstart Terminal which uses `Git Bash
   165  <https://git-scm.com/downloads>`__ and provides a better alternative
   166  to the built-in Windows shell.
   167  
   168  However experience has shown this to be a poor development environment
   169  with limited functionality. It is suitable to run Docker based
   170  scenarios, such as :doc:`getting_started`, but you may have
   171  difficulties with operations involving the ``make`` and ``docker``
   172  commands.
   173  
   174  On Windows 10 you should use the native Docker distribution and you
   175  may use the Windows PowerShell. However, for the ``binaries``
   176  command to succeed you will still need to have the ``uname`` command
   177  available. You can get it as part of Git but beware that only the
   178  64bit version is supported.
   179  
   180  Before running any ``git clone`` commands, run the following commands:
   181  
   182  ::
   183  
   184      git config --global core.autocrlf false
   185      git config --global core.longpaths true
   186  
   187  You can check the setting of these parameters with the following commands:
   188  
   189  ::
   190  
   191      git config --get core.autocrlf
   192      git config --get core.longpaths
   193  
   194  These need to be ``false`` and ``true`` respectively.
   195  
   196  The ``curl`` command that comes with Git and Docker Toolbox is old and
   197  does not handle properly the redirect used in
   198  :doc:`getting_started`. Make sure you install and use a newer version
   199  from the `cURL downloads page <https://curl.haxx.se/download.html>`__
   200  
   201  For Node.js you also need the necessary Visual Studio C++ Build Tools
   202  which are freely available and can be installed with the following
   203  command:
   204  
   205  .. code:: bash
   206  
   207  	  npm install --global windows-build-tools
   208  
   209  See the `NPM windows-build-tools page
   210  <https://www.npmjs.com/package/windows-build-tools>`__ for more
   211  details.
   212  
   213  Once this is done, you should also install the NPM GRPC module with the
   214  following command:
   215  
   216  .. code:: bash
   217  
   218  	  npm install --global grpc
   219  
   220  Your environment should now be ready to go through the
   221  :doc:`getting_started` samples and tutorials.
   222  
   223  .. note:: If you have questions not addressed by this documentation, or run into
   224            issues with any of the tutorials, please visit the :doc:`questions`
   225            page for some tips on where to find additional help.
   226  
   227  .. Licensed under Creative Commons Attribution 4.0 International License
   228     https://creativecommons.org/licenses/by/4.0/