Hyperledger Fabric (a) V2.0 base environment to build

System Environment: ubuntu-18.04.3-desktop-amd64

A, git (official website installation tutorial)
Method 1: sudo apt-get install git # apt-get install directly after installation is complete version of this method is 2.17.1, and git official website shows the latest version 2.25.0
Method 2 (adopted): ① sudo add-apt- repository ppa: git-core / ppa # add the latest version of git repository, the PPA provides the latest stable Git version
② sudo APT-GET Update
③ sudo APT-GET install git # installation The latest version of git
④ git --version # View version 2.25.0

Two, curl
1 (adopted): ① sudo apt install curl #curl official website shows the latest version 7.68.0, this approach, while not the latest version, but subsequent use is no problem
② curl --version # 7.58.0 version
Method 2: ① curl official website to download the latest version of source package curl-7.68.0.tar.gz # source installation, ubuntu-18.04.3 system can not find the make command, try to install some make their own tools, the implementation process error
② tar -zxvf curl -7.68.0.tar.gz
③ cd
④ ./configure
⑤ the make
⑥ the make install

Three, wget
to use ubuntu-18.04.3 own version, follow-up with no problems

Four, docker (according to the official website documentation installation site at https://docs.docker.com/install/linux/docker-ce/ubuntu/)
① sudo APT-GET-the Remove Docker Docker Engine docker.io containerd runc # delete old version, if docker is not installed before then ignore this step
② sudo apt-get update # update the apt package index
② sudo apt-GET install \
    apt-Transport-HTTPS \
    CA-Certificates \
    curl \
    GnuPG-Agent \
    Software-the Properties-the Common # install some packages, so apt can use HTTPS-based warehouse
-fsSL https://download.docker.com/linux/ubuntu/gpg ③ curl | sudo apt- key add - # add Docker's official GPG key
④ sudo apt-key fingerprint 0EBFCD88 # verify that you now have fingerprint key 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 of
⑤ sudo the Add-APT-Repository \
   "deb [Arch = AMD64] https://download.docker.com/ linux / ubuntu \
   $ (lsb_release -cs) \
   stable "# Use this command to set a stable repository, the command is different hardware architectures are different, the general PC or server x86_64 / AMD64
⑥ sudo APT-GET Update
⑦ sudo APT-GET install docker- ce docker-ce-cli containerd.io # command defaults to install the latest version docker engine, you can specify the version
⑧ sudo docker run hello-world # hello-world image by running, verify Docker engine - Community is installed correctly, the command to download a test image and run it in the container when the container is running, it prints a message message and exit.
in order to improve the image take-off speed, change the image source to domestic mirroring Ali (Ali cloud docker accelerator to get the address https: // cr.console.aliyun.com/cn-hangzhou/instances/mirrors):
① sudo vim /etc/docker/daemon.json # create a profile
② {
    "Registry-Mirrors": [
        "HTTPS: //9y1qsbw3.mirror. aliyuncs.com "# accelerator address the need to login to see Ali (Ali and personal accounts the only binding)
    ]
}
③ sudo systemctl daemon-reload
④ sudo systemctl restart docker # restart docker services
other settings:
① sudo systemctl enable # Set docker docker boot from the start
② sudo usermod -aG docker $ USER # set permissions ordinary user can operate docker (default root), $ USER value of the current users who download the system

Five, docker-compose (official website also has installation documentation at https://docs.docker.com/compose/install/)
Method 1: ① sudo curl -L "https://github.com/docker/compose/ Releases / downloads / 1.25.4 / Docker-Compose - $ (the uname -s) - $ (the uname -m) "-o / usr / local / bin / Docker-Compose
② the sudo the chmod + X / usr / local / bin / Compose-Docker
③ Docker Compose --version #-view version
Note: this method is more severely affected by network environment, the success of the next school network environment, and the failure at home broadband (mobile) environment, network timeout error or can not connect to the server and other
methods 2 (adopted): ① sudo apt install python- pip # install PIP
② PIP sudo install-Docker Compose
③ Docker Compose-view version --version #

Six, golang
① official website to download the installation package-amd64.tar.gz go1.13.7.linux
② tar -zxvf after go1.13.7.linux-amd64.tar.gz / usr / local # unzip files generated go under / usr / local directory clip
③ sudo vim / etc / profile # bin subdirectory and go to the workspace directory (by default $ HOME / go) added to the environment variables, as follows:
Export the PATH = $ the PATH: / usr / local / go / bin
Export GOPATH = $ HOME / go # $ HOME attention to the value of the current user's working directory ie / home / wangkaixuan, rather than / Home
Export the PATH = $ the PATH: $ GOPATH / Fabric-the Samples / bin #fabric binary file directory, this directory the configuration of the fabric binaries specific location, post-cloning Fabric of fabric-samples warehouse in GOPATH directory, the directory will be so

Seven, pull fabric-samples, fabric and related binary image
① mkdir / home / wangkaixuan / go # attention here not to use sudo, or behind when the script execution will be no write permissions to the directory file
② cd / home / wangkaixuan / go # to enter the working directory golang environment variable that is configured in the HOME $ / Go  
③ curl -ssl https://bit.ly/2ysbOFE | -s bash # default install the latest version of the script, by the network environment is more severe, school success under the net environment, while at home broadband (mobile) environment fails
after the end of the script, creates a fabric-samples directory in the current directory, ie / home / wangkaixuan / go, where there is bin binary directory (golang environment variables need to configure directory ), config configuration directory, chaincode chain code list, first-network and network directory fabcar other examples
may also specify the file version or pulling mirror: curl -sSL https://bit.ly/2ysbOFE | bash -s - 2.0.0 1.4.4 0.4.18 # <fabric_version> < fabric-ca_version> <thirdparty_version>

Eight other
sudo apt install openjdk-11-jre -headless # JDK11 installation (official documentation says java version of chaincode or SDK has been tested in JDK11 environment, so we choose JDK11)
 
Thus, the basic environment Hyperledger Fabric of the installation is complete, if you want to use node version of the SDK to develop applications, you also need to install node.js and npm

Guess you like

Origin www.cnblogs.com/always-kaixuan/p/12398251.html