区块链 fabric 1.4.4 搭建,Mysql 安装,区块链项目设计介绍

本文详细介绍了如何搭建区块链fabric 1.4.4版本,包括安装go环境、docker和docker-compose。同时,重点讲述了Mysql 5.27在Ubuntu 18.04上的安装过程,为区块链项目的实施提供了指导。
摘要由CSDN通过智能技术生成

一起学习、讨论的伙伴 +q 260261476,交流、指导!(https://blog.csdn.net/TBBetter/article/details/120749172)等项目设计
install go

wget -c https://studygolang.com/dl/golang/go1.16.3.linux-amd64.tar.gz
sudo tar -xz -f ./go1.16.3.linux-amd64.tar.gz -C /usr/local

sudo gedit ~/.bashrc
# 把下面这 4 行加入到文件末尾
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$GOPATH:$GOBIN:$GOROOT/bin:$PATH

source ~/.bashrc

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

install docker

sudo apt-get update

sudo apt-get install \
 apt-transport-https \
	ca-certificates \
 software-properties-common
 
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository \
	"deb [arch=amd64] https://download.docker.com/linux		/ubuntu \
	$(lsb_release -cs) \
	stable"

sudo apt-get update
sudo apt-get install docker-ce


sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
docker ps
sudo systemctl daemon-reload
sudo systemctl restart docker

4.测试 docker 是否安装成功, 返回 Hello from Docker!则成功!
docker run hello-world
5. images
	https://cr.console.aliyun.com/cn-hangzhou/instances

install docker-compose

sudo apt install docker-compose

Download source code

mkdir -p ~/go/src/github.com/hyperledger  && cd ~/go/src/github.com/hyperledger
git clone https://github.com/hyperledger/fabric.git
git clone https://github.com/hyperledger/fabric-samples.git

Download Images

https://cr.console.aliyun.com/?spm=5176.10695662.1362911.3.789c262cY82210

cd ~/go/src/github.com/hyperledger/fabric/scripts
sudo ./bootstrap.sh	

Download Mysql 5.27 ( ubuntu 18.04)

sudo apt-get update
sudo apt-get install mysql-server

sudo mysql_secure_installation
(NNYNY)

sudo mysql -uroot -p
GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "123456";

sudo geidt /etc/mysql/mysql.conf.d/mysqld.cnf
skip-grant-tables
service mysql restart
mysql -u root -p
update user set authentication_string=password("123456"),plugin='mysql_native_password' where user='root';
service mysql restart
#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

export VERSION=1.4.4
export CA_VERSION=1.4.4
export THIRDPARTY_IMAGE_VERSION=0.4.18
export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')")
export MARCH=$(uname -m)

printHelp() {
   
  echo "Usage: bootstrap.sh [version [ca_version [thirdparty_version]]] [options]"
  echo
  echo "options:"
  echo "-h : this help"
  echo "-d : bypass docker image download"
  echo "-s : bypass fabric-samples repo clone"
  echo "-b : bypass download of platform-specific binaries"
  echo
  echo "e.g. bootstrap.sh 1.4.4 -s"
  echo "would download docker images and binaries for version 1.4.4"
}

dockerFabricPull() {
   
  local FABRIC_TAG=$1
  for IMAGES in peer orderer ccenv tools; do
      echo "==> FABRIC IMAGE: $IMAGES"
      echo
      docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
      docker tag hyperledger/fabric-
  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值