首页 技术 正文
技术 2022年11月7日
0 收藏 336 点赞 1,076 浏览 3763 个字

Compile the source code

Step 1. 安装git

sudo apt-get install git

Step 2. 安装vagrant(ubuntu系统)

下载地址https://releases.hashicorp.com/vagrant/1.8.6/vagrant_1.8.6_x86_64.deb,然后双击,install即可。

在命令行中执行which vagrant,结果为/usr/bin/vagrant,说明安装成功

Step 3.安装VirtualBox

https://www.virtualbox.org/wiki/Linux_Downloads

Step 4.安装go

下载Go语言安装包https://storage.googleapis.com/golang/go1.7.1.linux-amd64.tar.gz

在命令行执行如下命令: sudo tar -C /usr/local -xzf go1.7.1.linux-amd64.tar.gz

Step 5.下载ubuntu镜像

p { margin-bottom: 0.1in; line-height: 120% }

https://atlas.hashicorp.com/hyperledger/boxes/fabric-baseimage/versions/0.1.0/providers/virtualbox.box

Rename the filename to blockchain.iso(whatever you what to call,It doesn’t matter)

Step 6.vim ~/.profile配置如下参数

p { margin-bottom: 0.1in; line-height: 120% }
a:link { }
vim ~/.profile配置如下参数
–> { }
p { margin-bottom: 0.1in; line-height: 120% }
a:link { }
vim ~/.profile配置如下参数
–> { }

export GOROOT=/usr/local/go

export GOPATH=/opt/gopath

export GOBIN=/usr/local/go/bin

export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

save and then run  source ~/.profile

Step 7.创建GOPATH路径

cd /optsudo mkdir gopathsudo chown -R gupp:gupp gopath //change the owner and group to your computer

Step 8.创建farbic相关目录

cd $GOPATHmkdir -p src/github.com/hyperledgercd github.com/hyperledger

Step 9:下载代码

fork the source code to your own git repositories

git clone https://github.com/minxinfeng/fabric.git //the fabric must be in the folder $GOPATH/src/github.com/hyperledger

pre.cjk { font-family: “Nimbus Mono L”, monospace }
p { margin-bottom: 0.1in; line-height: 120% }
a:link { }

10.Attach the box we downloaded into vagrant:

cd $GOPATH/src/github.com/hyperledger/fabric/devenvvagrant box add --name hyperledger/fabric-baseimage  /home/gupp/blockchain.iso

11.Modify the file Vagrantfile

comment these commands:

#./setup #that means it will run setup file to do somethings#config.vm.box_version = ENV[

12.Start virtualbox using command   vagrant up  ,can refer this document:fabric devenv Vagrantfile配置

13.SSH to virtualbox and do something using command  vagrant ssh

14.The
following steps we will do in the VM
, and in folder
$GOPATH/src/github.com/hyperledger/fabric/devenv

setup.sh
do the following things, so we split it into seveal parts to run

1)Install docker and
start the docker service

2)Install some
useful commands by  /hyperledger/scripts/provision/host.sh, such
as docker-compose/python-dev/libyaml-dev/Python
grpc/Tcl/NPM/Jdk/Gradle.

Note:The
docker-compose and gradle are downloaded from network. I changed to
download it first and then using local file to install

3)compile the
commads by    make clean peer

4) set the
environment

Then, we can in
folder fabric to make images and memberserv

make images  //Then
using command docker images can find the images we just made

make memberserv

Note:DO
NOT USE SUDO

15. Package
our box

cd $GOPATH/src/github.com/hyperledger/fabric/devenvvagrant package

now we get the package.box that can be used in other Ubuntu System following the next steps.

Install on other Ubuntu System with the package.box generated

1.Do the same thing following the above steps: step2,3,4,6,7,8

2.Copy the fabric folder(with the compiled files) into folder $GOPATH/src/github.com/hyperledger

3.Attach the box we packaged into vagrant:

cd $GOPATH/src/github.com/hyperledger/fabric/devenvvagrant box add --name hyperledger/fabric-baseimage  /home/gupp/package.box

4.Modify the file Vagrantfile

comment these commands:

#./setup #that means it will run setup file to do somethings#config.vm.box_version = ENV[

5.Start virtualbox using command  vagrant up ,can refer this document:fabric devenv Vagrantfile配置

6.SSH to virtualbox and do something using command  vagrant ssh

And now we install it, enjoy your blockchain

Problems

Run commands 1-8 in a virtualbox running on Windows:

//进入devenv所在文件夹cd $GOPATH/src/github.com/hyperledger/fabric/devenv//执行如下命令vagrant up//该命令行直接下载ubuntu镜像,下载地址https://atlas.hashicorp.com/hyperledger/boxes/fabric-baseimage/versions/0.0.11/providers/virtualbox.boxvagrant ssh

vagrant执行完成之后,报错,因为在虚拟机中无法再次开启虚拟机,因此只能在真机上进行环境部署。错误信息如下:

TBD

1. core/chaincode/shim/java/javabuild.sh How to configure the jar by using local jar

2. make gotools :There have some questions

数据库位置/var/hyperledger/production

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,491
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,493
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,294