github.com/darrenli6/fabric-sdk-example@v0.0.0-20220109053535-94b13b56df8c/docs/source/prereqs.rst (about) 1 Prerequisites 2 ============= 3 4 Install cURL 5 ------------ 6 7 Download the latest version of the `cURL 8 <https://curl.haxx.se/download.html>`__ tool if it is not already 9 installed or if you get errors running the curl commands from the 10 documentation. 11 12 .. note:: If you're on Windows please see the specific note on `Windows 13 extras`_ below. 14 15 Docker and Docker Compose 16 ------------------------- 17 18 You will need the following installed on the platform on which you will be 19 operating, or developing on (or for), Hyperledger Fabric: 20 21 - MacOSX, *nix, or Windows 10: `Docker <https://www.docker.com/products/overview>`__ 22 Docker version 17.03.0-ce or greater is required. 23 - Older versions of Windows: `Docker 24 Toolbox <https://docs.docker.com/toolbox/toolbox_install_windows/>`__ - 25 again, Docker version Docker 17.03.0-ce or greater is required. 26 27 You can check the version of Docker you have installed with the following 28 command from a terminal prompt: 29 30 .. code:: bash 31 32 docker --version 33 34 .. note:: Installing Docker for Mac or Windows, or Docker Toolbox will also 35 install Docker Compose. If you already had Docker installed, you 36 should check that you have Docker Compose version 1.8 or greater 37 installed. If not, we recommend that you install a more recent 38 version of Docker. 39 40 You can check the version of Docker Compose you have installed with the 41 following command from a terminal prompt: 42 43 .. code:: bash 44 45 docker-compose --version 46 47 .. _Golang: 48 49 Go Programming Language 50 ----------------------- 51 52 Hyperledger Fabric uses the Go programming language 1.7.x for many of its 53 components. 54 55 .. note: Go version 1.8.x will yield test failures 56 57 - `Go <https://golang.org/>`__ - version 1.7.x 58 59 Given that we are writing a Go chaincode program, we need to be sure that the 60 source code is located somewhere within the ``$GOPATH`` tree. First, you will 61 need to check that you have set your ``$GOPATH`` environment variable. 62 63 .. code:: bash 64 65 echo $GOPATH 66 /Users/xxx/go 67 68 If nothing is displayed when you echo ``$GOPATH``, you will need to set it. 69 Typically, the value will be a directory tree child of your development 70 workspace, if you have one, or as a child of your $HOME directory. Since we'll 71 be doing a bunch of coding in Go, you might want to add the following to your 72 ``~/.bashrc``: 73 74 .. code:: bash 75 76 export GOPATH=$HOME/go 77 export PATH=$PATH:$GOPATH/bin 78 79 Node.js Runtime and NPM 80 ----------------------- 81 82 If you will be developing applications for Hyperledger Fabric leveraging the 83 Hyperledger Fabric SDK for Node.js, you will need to have version 6.9.x of Node.js 84 installed. 85 86 .. note:: Node.js version 7.x is not supported at this time. 87 88 - `Node.js <https://nodejs.org/en/download/>`__ - version 6.9.x or greater 89 90 .. note:: Installing Node.js will also install NPM, however it is recommended 91 that you confirm the version of NPM installed. You can upgrade 92 the ``npm`` tool with the following command: 93 94 .. code:: bash 95 96 npm install npm@3.10.10 -g 97 98 Windows extras 99 -------------- 100 101 If you are developing on Windows, you will want to work within the 102 Docker Quickstart Terminal which provides a better alternative to the 103 built-in Windows such as `Git Bash <https://git-scm.com/downloads>`__ 104 which you typically get as part of installing Docker Toolbox on 105 Windows 7. 106 107 However experience has shown this to be a poor development environment 108 with limited functionality. It is suitable to run Docker based 109 scenarios, such as :doc:`getting_started`, but you may have 110 difficulties with operations involving the ``make`` command. 111 112 Before running any ``git clone`` commands, run the following commands: 113 114 :: 115 116 git config --global core.autocrlf false 117 git config --global core.longpaths true 118 119 You can check the setting of these parameters with the following commands: 120 121 :: 122 123 git config --get core.autocrlf 124 git config --get core.longpaths 125 126 These need to be ``false`` and ``true`` respectively. 127 128 The ``curl`` command that comes with Git and Docker Toolbox is old and 129 does not handle properly the redirect used in 130 :doc:`getting_started`. Make sure you install and use a newer version 131 from the `cURL downloads page <https://curl.haxx.se/download.html>`__ 132 133 For Node.js you also need the necessary Visual Studio C++ Build Tools 134 which are freely available and can be installed with the following 135 command: 136 137 .. code:: bash 138 139 npm install --global windows-build-tools 140 141 See the `NPM windows-build-tools page 142 <https://www.npmjs.com/package/windows-build-tools>`__ for more 143 details. 144 145 Once this is done, you should also install the NPM GRPC module with the 146 following command: 147 148 .. code:: bash 149 150 npm install --global grpc 151 152 Your environment should now be ready to go through the 153 :doc:`getting_started` samples and tutorials. 154 155 .. note:: If you have questions not addressed by this documentation, or run into 156 issues with any of the tutorials, please visit the :doc:`questions` 157 page for some tips on where to find additional help. 158 159 .. Licensed under Creative Commons Attribution 4.0 International License 160 https://creativecommons.org/licenses/by/4.0/